Notice: This thread is over two years old; the information may be outdated. Please consider creating a new thread if you require free support. If you have an active SiteOrigin Premium license, you can email our premium support desk at [email protected].
The documentation for bundling prebuilt layouts (https://siteorigin.com/docs/page-builder/bundling-prebuilt/) refers to v2.4.x.
Version 2.5 has import / export functionality for layouts but it is unclear how to bundle these with a theme.
I’ve tried out the new Layout Viewer theme on Github but this is overkill for what I want to do.
How do I set up bundled layouts so my users can use them without needing to import each time?
Hi Julian
Thanks for the bump. Will get those docs updated ASAP. The new method will look something like this:
https://github.com/robhope/fullsingle/blob/master/functions/function-layouts.php
https://github.com/robhope/fullsingle/blob/master/layouts/flyleaf/flyleaf.php
Let me know if that helps.
The old documentation for functions.php still works:
Unfortunately you need to decode the json and extract the array from the resulting object:
NB: this is just an example, you’d probably want to decode the json once offline and insert the array instead.
@andrew, thanks for the code. I posted before seeing your reply. I’ll try that now.
@Andrew Thanks, that works.
For anyone copy/pasting @andrew’s code:
the layouts directory should go at the top level of your themes directory, not in your theme
Change the path set in $layout_dir in function_layouts.php to move it into your theme dir.
Thanks for adding the notes. Glad to hear you’ve made progress. Sorry for the hassle.