Log1x / acf-composer

Compose ACF Fields, Blocks, Widgets, and Option Pages with ACF Builder on Sage 10.
https://github.com/Log1x/acf-composer
MIT License
419 stars 57 forks source link

Block sub-directories #169

Closed smithd88 closed 1 year ago

smithd88 commented 1 year ago

I would like to organize my blocks by putting them into directories by type. but have not been able to find a working solution for the templates.

I have been able to implement a partial solution by using namespaces: App\Blocks\Hero;

/Blocks
    /Hero
        Hero1.php
        Hero2.php

I have not been able to find a working solution for the templates. Is there some combination of slug, view, etc. that can create this structure that I have misunderstood?

/blocks
    /hero
        hero1.blade.php
        hero2.blade.php
smithd88 commented 1 year ago

This can be accomplished by using view the correct way. Given the example above you could do the following:

/**
 * The block view.
 *
 * @var string
 */
public $view = 'blocks.hero.hero1';