You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a slight problem. I'm trying to create a pagebuilder where I keep the layouts in separate partials. I have read your readme file and searched in endlessly in the Sage community without solving this issue. Could you please point me to the right direction?
Much appreciated,
Petteri
Test.php
<?php
namespace App\Fields;
use Log1x\AcfComposer\Field;
use StoutLogic\AcfBuilder\FieldsBuilder;
use App\Fields\Partials\Builder;
use App\Fields\Partials\Text;
use App\Fields\Partials\ListItems;
class Test extends Field
{
/**
* The field group.
*
* @return array
*/
public function fields()
{
$test = new FieldsBuilder('Sidbyggare');
$test
->setLocation('post_type', '==', 'page')
->and('post', '==', '2');
$test
->addFields($this->get(Builder::class))
->addFields($this->get(ListItems::class));
return $test->build();
}
}
Builder.php
<?php
namespace App\Fields\Partials;
use Log1x\AcfComposer\Partial;
use StoutLogic\AcfBuilder\FieldsBuilder;
use App\Fields\Partials\Text;
class Builder extends Partial
{
/**
* The partial field group.
*
* @return \StoutLogic\AcfBuilder\FieldsBuilder
*/
public function fields()
{
$builder = new FieldsBuilder('builder');
$builder
->addFlexibleContent('komponenter', [
'button_label' => 'Lägg till komponent',
])
->addFields($this->get(Text::class))
->endFlexibleContent();
return $builder;
}
}
Text.php
<?php
namespace App\Fields\Partials;
use Log1x\AcfComposer\Partial;
use StoutLogic\AcfBuilder\FieldsBuilder;
class Text extends Partial
{
/**
* The partial field group.
*
* @return \StoutLogic\AcfBuilder\FieldsBuilder
*/
public function fields()
{
$text = new FieldsBuilder('text');
$text
->addLayout('layout', [
'label' => 'Layout',
'display' => '',
'sub_fields' => [],
'min' => '',
'max' => '',
])
->addText('title')
->setWidth('30')
->addWysiwyg('content')
->setWidth('30')
->addRange('width');
return $text;
}
}
The text was updated successfully, but these errors were encountered:
Hi!
First of all, great tool for ACF!
I have a slight problem. I'm trying to create a pagebuilder where I keep the layouts in separate partials. I have read your readme file and searched in endlessly in the Sage community without solving this issue. Could you please point me to the right direction?
Much appreciated,
Petteri
Test.php
Builder.php
Text.php
The text was updated successfully, but these errors were encountered: