Good afternoon, how are you?
I’m currently studying the development of a project in Sage 10. I am currently delving into the configuration of ACF for creating page options and page templates.
I’m not entirely sure how the logic used in the following link works: GitHub - Log1x/acf-composer: Compose ACF Fields, Blocks, Widgets, and Option Pages with ACF Builder on Sage 10. for configuration. I say this because I haven’t been able to create page options or any other features using controllers.
Since I’m in a simpler development environment, I can’t execute the “wp acorn” functions, and I would like to understand the logic behind this structure more thoroughly. This will help me to truly understand what is happening.
I apologize in advance for any basic or intrusive questions. I am new to Sage, and I am really enjoying working with the tool. In fact, that’s the reason I want to delve deeper into it.
Additional Information:
I have a recently installed Sage 10 theme following the standard instructions. All directories are in their default installation state.
What I did was:
- Create “config/acf.php”
- Create the “Options” folder in “app” with the following content:
OptionPage.php
<?php
namespace OptionPage;
use Log1x\AcfComposer\Options as Field;
use StoutLogic\AcfBuilder\FieldsBuilder;
class OptionPage extends Field
{
/**
* The option page menu name.
*
* @var string
*/
public $name = 'Option Page';
/**
* The option page document title.
*
* @var string
*/
public $title = 'Page | Options';
/**
* The option page field group.
*
* @return array
*/
public function fields()
{
$DummyCamel = new FieldsBuilder('OptionPage');
$DummyCamel
->addRepeater('items')
->addText('item')
->endRepeater();
return $DummyCamel->build();
}
}