XF 2.0 Creating Styles with Template Modifications

AndrewSimm

Well-known member
I am trying to understand the relationship between styles and the TMS system built into XF2. I've created a handful of mods and understand how those changes to templates are done when the mods are enabled. I also understand how mods handle templates and css. What I am unclear on is how a style and the TMS system interact.

Currently I am using XF2 DP9, which I created a new style in and have used exclusively either the style properties or the extra.css within the style. Today I wanted to make a change to the template, so I used the TMS system, which I had to associate with a mod. To make this work I created a mod that is currently representing only the 2 template changes I've made with TMS. I've gone back and read the "Creating a Style" on XF2 Demo, and now I am a bit confused. First, would that allow me to associate the TMS change with the style, and if so how? Last, is there something I need to do to fix my current style to make it follow the expected path.
 
It can't be done. Template modifications are used only for add-ons.

You can't use it for styles for one major reason: template modifications are applied to master style. That means template modifications will be added to all other styles that have nothing to do with your style, possibly messing up other styles installed on forum.
 
It can't be done. Template modifications are used only for add-ons.

You can't use it for styles for one major reason: template modifications are applied to master style. That means template modifications will be added to all other styles that have nothing to do with your style, possibly messing up other styles installed on forum.

That makes sense, so I guess all template changes need to me made with the style template? What advantage does the designer mode offer over just creating a style within the XF2 UI?
 
That makes sense, so I guess all template changes need to me made with the style template? What advantage does the designer mode offer over just creating a style within the XF2 UI?
The templates are output to the file system where you can then edit them. Also can help with version control of templates and style properties (properties are output in JSON format in designer mode).

https://xf2demo.xenforo.com/dev-docs/designing-styles/
 
Another question is if an edit the header, which is in PAGE_CONTAINER, how would I get any changes not affected by my edits to the template?
 
What's the difference between the json export and the xml export that I can generate from my style list? Why couldn't I just export this and then re-import?
Those are completely different things. XML export exports entire style, so it could be imported on another forum. JSON is used to store style properties on file system during development.

Try using development mode from command line, you'll quickly understand how it works. Type
Code:
php cmd.php list
in terminal to get list of all command line functions
 
Back
Top Bottom