Skip to content

Instantly share code, notes, and snippets.

@webgurus
Last active October 22, 2021 07:05
Show Gist options
  • Save webgurus/96839c415a48e9b21ebe6d586f49b557 to your computer and use it in GitHub Desktop.
Save webgurus/96839c415a48e9b21ebe6d586f49b557 to your computer and use it in GitHub Desktop.
The flexible content page builder content part
@if($page_builder)
@foreach ($page_builder as $block)
@include('partials/page-builder/'.$block->block_type)
@endforeach
@endif
@webgurus
Copy link
Author

Create a file called /partials/content-flexible.blade.php

Then all the block partials (matched by the name of the flexible block) will be automatically loaded from /partials/page-builder/.

E.g. if you have a flexible block called "two_column" then it will automatically search for a blade partial named /partials/page-builder/two_column.blade.php

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment