XF 1.2 Loading of additional css files, and how to use Template Modifications on it?

SchmitzIT

Well-known member
In PAGE_CONTAINER, css files are loaded. I'm using Luke Foreman's Kotomi add-on to then embed a third-party program within XenForo.

However, the css file is loaded by directly calling .css, which using Kotomi means that it's looking for the css page within the current folder. I addressed that by adding a Template Modification that references the boardUrl and thus pretty much "hard-code" it to grab the right file.

Now I'm having a minor issue where the non-default XenForo CSS is not properly loaded, and I'm hoping that I can somehow pull the same trick for that. I sidestepped the issue for now by hard-coding the call to the css I can see in the page's source, but obviously this is far from optimal (adding a new add-on would mean the line would have to be fixed again).

In PAGE_CONTAINER, the following line appears:

Code:
<!--XenForo_Require:CSS-->

I assume that is a hook for adding all the additional CSS files from add-ons. Is there any way I could somehow have the board url automatically put in front of the css.php file reference there?
 
The one I made?

I replace

Code:
<link rel="stylesheet" href="css.php?css=xenforo,form,public&amp;style={xen:urlencode $_styleId}&amp;dir={$visitorLanguage.text_direction}&amp;d={$visitorStyle.last_modified_date}" />

with

Code:
<link rel="stylesheet" href="{$xenOptions.boardUrl}/css.php?css=xenforo,form,public&amp;style={xen:urlencode $_styleId}&amp;dir={$visitorLanguage.text_direction}&amp;d={$visitorStyle.last_modified_date}" />

<link rel="stylesheet" href="{$xenOptions.boardUrl}/css.php?css=Gritter,GritterEXTRA,footer_custom,moderator_bar,sonnb_xengallery_navbar_template,xfa_blogs_nav&style=1&dir=LTR&d=1385910561"/>

The second line as you can see contains CSS files for several add-ons, and every time I'd add a new add-on with its own CSS, that line would have ben altered.
 
Well, the first line does little more than adding the boardURL to the existing call to css.php in the template. That bit works wonderful. I'm mostly trying to figure out where in XenForo the additonal css is added.

I'm guessing it's at the line:

Code:
<!--XenForo_Require:CSS-->

The extra css is hooked, but if I'd want to manipulate the generated URL to add the board-name, I haven't been able to figure out how to do this.

Incidentally, could you shed some light onto why the PAGE_CONTAINER template is referring to css.php in the template, and not {$boardURL}/css.php to begin with?
 
Back
Top Bottom