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

XF 1.1 TMS multiple modifications based on one template?

Discussion in 'XenForo Questions and Support' started by Neil E., Jul 14, 2012.

  1. Neil E.

    Neil E. Active Member

    I have one template in which I set search to contain the whole code block. This is because I had one edit at the very beginning and one edit at the very end. It works fine but now I'm thinking it would make sense to have two mods based on the original template. One for the beginning code change and one for the ending code change. The idea being that the bulk of the code would not be in the mod and there would be less chance of a conflict when upgrading.
     
  2. Chris D

    Chris D XenForo Developer Staff Member

    What's your question?

    It is possible to do multiple template modifications on a single template using TMS.
     
  3. Neil E.

    Neil E. Active Member

    Yes, can I do multiple mods on one template?

    Does a mod stop working if an upgrade changes original template code resulting in a difference with the code in the TMS search box?
     
  4. Chris D

    Chris D XenForo Developer Staff Member

    Yes, you can do multiple mods in one template.

    A mod can stop working if the template changes - but hopefully easier to fix and identify.
     
  5. Neil E.

    Neil E. Active Member

    I need to explain this better. I'll try an example for the navigation template.

    METHOD 1
    navigation - new modification called "first and last changed together"
    search: all of template code
    replace: all code including new first line + new last line

    METHOD 2
    navigation - new modification called "first line change"
    search: first line of code
    replace: new first line of code

    and based on the same original template

    navigation - new modification called "last line change"
    search: last line of code
    replace: new last line of code

    Method 2 should reduce the possibility of a template mod not working when the original template is changed due to an upgrade
     
  6. Chris D

    Chris D XenForo Developer Staff Member

    Yep, Method 2 will work and is better.
     
  7. Neil E.

    Neil E. Active Member

    Thanks


    Re: template change from an upgrade. Does XenForo show us there is an outdated template if all mods are done ONLY via TMS? Or can the TMS show us? [like how it puts a line though the mod title when it's unchecked]
     
  8. Chris D

    Chris D XenForo Developer Staff Member

    As far as XenForo is concerned, the templates aren't actually changed so that won't tell you.

    But yeah, TMS will show errors. Notice how it says "Applied 1 Times" etc? This might change red and say "Applied 0 Times" if it can no longer match your replacements.
     
  9. Neil E.

    Neil E. Active Member

    Good explanation. Many thanks.
     
    Yorick likes this.
  10. Neil E.

    Neil E. Active Member

    I had a chance to test this. I split one big mod into two smaller ones. Checked the difference using just one of them and thought I had messed up. In reality it was checking the final template so the result showed both modifications applied. Much better for testing with two small mods instead of one big one. I also tested a mistake and the TMS shows Applied 0 Times in red. Very easy to spot. The TMS is an extremely useful addon.
     
    Yorick likes this.

Share This Page