Initial commit to github

This commit is contained in:
Keith Solomon
2025-08-22 15:40:01 -05:00
commit e8efdbeb34
230 changed files with 32213 additions and 0 deletions

View File

@@ -0,0 +1,27 @@
{
"name": "acf/grid",
"title": "Grid Block (VDI)",
"description": "Custom grid block.",
"style": [
"file:./grid.css"
],
"allowedBlocks": [ "acf/grid-cell" ],
"category": "vdi-block",
"icon": "grid-view",
"keywords": [
"grid"
],
"acf": {
"mode": "preview",
"renderTemplate": "grid.php"
},
"supports": {
"align": false,
"anchor": true,
"color": false,
"html": false,
"jsx": true,
"mode": true,
"multiple": true
}
}

View File

View File

@@ -0,0 +1,47 @@
<?php
/**
* Block Name: Grid
*
* This is the template that displays the grid block.
*
* @package BasicWP
*/
namespace BasicWP;
$allowedBlocks = array( 'acf/grid-cell' );
$default_blocks = array(
array( 'acf/gric-cell' ),
);
// Initialize variables
$anchor = ! empty( $block['anchor'] ) ? $block['anchor'] : 'grid-' . $block['id'];
$className = ! empty( $block['className'] ) ? $block['className'] : '';
$colBPs = get_field( 'columns_breakpoints' );
$gapX = get_field( 'gap_x' );
$gapY = get_field( 'gap_y' );
$gridClasses = 'grid grid-cols-' . get_field( 'columns' );
// Add breakpoint-specific column classes
if ( $colBPs ) {
foreach ( $colBPs as $bp ) {
$gridClasses .= ' ' . $bp . ':grid-cols-' . get_field( 'columns_' . $bp );
}
}
// Add gap classes
if ( $gapX ) {
$gridClasses .= ' gap-x-' . $gapX;
}
if ( $gapY ) {
$gridClasses .= ' gap-y-' . $gapY;
}
// Combine all classes
$classes = trim( $className . ' ' . $gridClasses );
?>
<div id="<?php echo esc_attr( $anchor ); ?>">
<InnerBlocks className="<?php echo esc_attr( $classes ); ?>" />
</div>