XF 2.2 Including a less template in page_container

Lee

Well-known member
I want to include a .less template in my page_container, but before extra.less is called. What is the best practise for achieving this? :)
 
I would suggest calling the less template in the extra.less template itself.

Less:
{{ include('template_name.less') }}

If you add it at the top, it should be processed first.
 
I would suggest calling the less template in the extra.less template itself.

Less:
{{ include('template_name.less') }}

If you add it at the top, it should be processed first.
Any reason you can think of that when doing this, and creating the template in the style that they aren't being callled?
I'm primarily trying to get all the prefix and navigation customizations out into two separate LESS files..

Code:
{{ include('custom_prefixes.less') }}
{{ include('custom_navigation.less') }}
is at the top of my Extra.LESS and those templates exist in that style, but they aren't being called.
Has this changed in 2.2?
 
is at the top of my Extra.LESS and those templates exist in that style, but they aren't being called.
Has this changed in 2.2?
I see no reason why this would not work.

If you don't want to do the extra.less changes for every style, you can create a template modification (will only work in development mode!):

Template extra.less
Search type Regular expression
Search for /$/ (i.e. "append to the end")
Replace with: -> your code here, e.g. {{ include('custom_prefixes.less') }}
 
is at the top of my Extra.LESS and those templates exist in that style, but they aren't being called.
Has this changed in 2.2?
Are you using the same classes as the core?

It's possible they are being applied but then overwritten.
Do you see them crossed out in the browser inspector?
 
Are you using the same classes as the core?
Yep... can carry on.. one of the reasons of me wanting to break it out into separate templates is what bit me in the arse.... amazing how two little
Less:
}
}
being out of place can affect you.... and for some reason, at one point it wasn't giving me any errors... finally cut/pasted it enough times and totally removed portions from the main EXTRA.less and the two closing designators showed up as missing.

It's all cleaned up now... thanks!

If you don't want to do the extra.less changes for every style, you can create a template modification (will only work in development mode!):
May try this... but it's not that big of a deal to cut/paste between the two styles (all I use)... and I am making frequent edits to it so bouncing in/out of development model may be more of a hassle than simple cut/paste.
If I was running more than 2 styles, I'd most likely do this.
 
May try this... but it's not that big of a deal to cut/paste between the two styles (all I use)... and I am making frequent edits to it so bouncing in/out of development model may be more of a hassle than simple cut/paste.
If I was running more than 2 styles, I'd most likely do this.
Just wanted to bring this up as an alternative. But, you would only have to use dev mode once: to create the template modification. Afterwards you could edit the templates that you include with the template modification like normal. ;)
 
Top Bottom