1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

XF 1.4 Best practices for managing similar styles and templates across multiple sites

Discussion in 'XenForo Questions and Support' started by Joe Link, Jan 7, 2015.

  1. Joe Link

    Joe Link Well-Known Member

    I'm learning a lot about XF development every chance I get, I love it. As with everything, there are usually multiple ways to do something, and only one way to really do it correctly. I want to make sure I know and understand the correct concepts.

    I have multiple sites which all use the same custom style as a base, which @Russ did a fantastic job developing. For ease of management, I want to keep everything the same from site to site, with the exception of colors, images, and a couple add-ons.

    What I need to know is the best way to go about maintaining standardized style and template modifications across the multiple sites. @AndyB (great guy!) advised me to learn how to create an add-on each template edit rather than editing the templates themselves, which makes complete sense to me. I'm hoping this will allow me to create an add-on, export it from dev to production, and keep track of the changes I've made.

    The styles I'm still not quite sure about, but the example of the transparent plastic sheet helped the inheritance make more sense to me. If I wanted the only change between the styles of multiple sites to be colors and images, I'd just designate one style on my dev site to be 'Joe Link's Master Style' and create child styles with the few differences? Then, by editing the master style on the dev site and exporting it, it would ensure the sites stayed in sync?

    As always, I really appreciate your help :)
  2. Mike

    Mike XenForo Developer Staff Member

    Yes, that would work. If you are using a 3rd party style as a base, you may wish to not edit that style either (using a inherited version to do your customizations). That will ease style upgrades.
  3. Joe Link

    Joe Link Well-Known Member

    Thanks for the info Mike. If I understand correctly, it would look like this?

    Master Style
       3rd Party Style
          Editable 3rd Party Style
             Site Specific Style
             Site Specific Style
             Site Specific Style
  4. Mike

    Mike XenForo Developer Staff Member

  5. Joe Link

    Joe Link Well-Known Member

    Will do. Do you agree about the template thing? Anything else I can or should do to realize my goals of standardization?
  6. thedude

    thedude Well-Known Member

    We have a few XF sites as well, and we created a Miscellaneous add-on containing several Template Modifications. So when we change something on the dev site (via a template mod), we simply export the add-on again then reimport it into the other sites and they all get the change.
    Joe Link and Steve F like this.
  7. Joe Link

    Joe Link Well-Known Member

    So rather than creating an add-on for each change, I can just roll all of the modifications into one add-on, then keep track of the various changes in the Template Modification section?
  8. Brogan

    Brogan XenForo Moderator Staff Member

    Joe Link likes this.
  9. Joe Link

    Joe Link Well-Known Member

    Great tip, I'm sure that'll save me some time :D

Share This Page