• 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?

Neil E.

Active member
#1
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.
 

Chris D

XenForo developer
Staff member
#2
What's your question?

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

Neil E.

Active member
#3
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?
 

Chris D

XenForo developer
Staff member
#4
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.
 

Neil E.

Active member
#5
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
 

Neil E.

Active member
#7
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]
 

Chris D

XenForo developer
Staff member
#8
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.
 

Neil E.

Active member
#10
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.