-
-
Notifications
You must be signed in to change notification settings - Fork 57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Best practise for Flexible Content #257
Comments
It should be simplified to |
Oh, I think you can just pass the partial straight to acf-composer/src/Builder/FlexibleContentBuilder.php Lines 64 to 75 in 284c40b
Sorry, I never use Flexible Content anymore so I couldn't entirely remember. #252 should fix this. |
Also, assuming all works well – we can probably get a rule for that in the upgrade command. |
Hey, thanks for coming back to me. When I try to pass the partial class in like this ->addLayout(Text::class) It wasn't working. Although the following does, so maybe I've misunderstood. class PageBuilder extends Partial
{
public function fields()
{
$pageBuilder = Builder::make('pageBuilder');
$pageBuilder
->addFlexibleContent('components', ['label' => 'Blocks'])
->addLayout('Text')->addPartial(Text::class)
->endFlexibleContent();
return $pageBuilder;
}
} Thanks for your help! |
Ah I see. It's good the latter works – but I think we can make it a bit better in the future. 👍 |
Hey,
Looking through some of the code and issues it seems like #175 is the most up to date information it. But in the code, it says that
$this->get()
is deprecated.Is there a better/more up-to-date way of adding partials as layouts when using Flexible Content?
Cheers
The text was updated successfully, but these errors were encountered: