XF 2.0 Template modification for non-master template - best practice?

S Thomas

Well-known member
Situation: I have a template which does not exist in the master template. This template gets edited frequently by the customer. I have to generically add something to the template everytime the customer adds a structure to the template.
Example:
CSS:
.class-x {
    color:red;
}
Template modification:
CSS:
.class-x, .class-x-inner { #TMS adds ", .class-x-inner"
    color:red;
}
Yea, pretty much that. That works with a regex and template modifications. However, as I mentioned, the template does not exist in the master style, thus would get deleted when master data would be rebuilt even if I added that template to the master style (right?).
What would be the best approach here? Tell the customer to add the "inner" class himself? Create a master template and stick that to an addon?
 
A template does not necessarily have to exist in MASTER for template modifications to work; as long as the regex works they will be active in child styles.
So you can just create the template modifiction as if the template existed.
 
Huh? Either I'm blind or I'm pretty sure that did not work when I tried it out. Gonna report back in a sec.
 
Back
Top Bottom