Home>Support>What is best way to manage re-usable components?

What is best way to manage re-usable components?

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].

I really want to use Page Builder to build my next site. The problem I’m having is I don’t understand how/where I can save re-usable components without having to write _too_ much code (I don’t have a problem with code snippets up to about 20 lines, or with creating templates).

Let’s say I want to use Page Builder to create the masthead on my site, containing a logo and the primary menu area. This does not change, it’s the same on every page. The way I see it, even if you are cloning pages or creating custom templates, you are repeating that change on every existing page. Is that true, and if not, how do I make a change in one place and have it affect all pages?

One thought I had was to build a widget to output the masthead code. That way, you create a “my masthead” widget and put it in the top row of a page. When code needs changing, you change the widget once and it impacts every page including the widget. It seems kind of a headache to write widgets for all the repeatable components, but it would work. My real question is “is there a better way?”

While I’m at it, how would the widget classes created by SiteOrigin play into this? Do they make the job dramatically easier?

This is our free support forum. Replies can take several days. If you need fast email support, please purchase a SiteOrigin Premium license.

  1. 8 years, 11 months ago Andrew Misplon
    Hi, I Work Here

    Hi Scott

    Thanks for reaching out, sorry we weren’t able to reply sooner.

    In the case of a masthead, a widget area would be the easiest way to go. You’d add a normal theme widget area to your functions file and then insert a Layout Builder widget into that widget area to work with Page Builder.

    For everything else, we can finally show you the Custom Post Type Builder: Page: Custom Post Type Builder. The documentation I wrote in that section needs a round two but hopefully, it gives you some idea of what you can now do with Page Builder and Custom Post Types. The CPT Builder is part of our newly released SiteOrigin Premium offering: Download: SiteOrigin Premium.

    Let me know if you have any questions or any documentation suggestions.

Replies on this thread are closed. Please create a new thread if you have a question, or purchase a SiteOrigin Premium license if you need one-on-one email support.

Get The Most Out of SiteOrigin with SiteOrigin Premium

Find Out More