XF 2.1 Why is CSS cached in the ACP?

ShanePike

Member
I'm making changes to the banner styles. I have modified app_user_banners.less, and the changes are reflected correctly in the forum. They are not reflected in the ACP, though. The ACP appears to be using a cached version of the original CSS, and I can't figure out how to get it to refresh.

I've tracked it down to the URL used by the ACP vs the URL used by the forum itself, but that's where I'm stuck.

The ACP uses a URL like this one:

The forum uses a URL like this one:

If the number after "s=" is 1 or greater, you get a non-cached, live version of the CSS. If it is 0, a letter, or if "s=" doesn't appear at all, you always get the original version of app_user_banners.less. (I included an unused class name and style at the beginning so it's easier to tell which version is the updated version.)

How do I get the ACP to pull an updated copy of app_user_banners.less?
 
The s parameter is the style ID. The Admin Control Panel is using the Master Style (style ID 0), which is the single source of truth or basis for all other styles inheriting from it, and you're not able to edit it unless you send your forum into development mode. Changes to the master style are not recommended and would be overwritten when you update XenForo.

Or TL;DR: You're not able to change the styling of the admin control panel.
 
That is an outstanding answer. Thank you so much!

As I understand it (and I easily could be wrong) I have two options for custom banners:
  1. Restyle the original banners. The problem with this is that I can't see what the new styling looks like from within the ACP. I just have to know what the ACP versions correspond to on the actual forum.
  2. Create my own styles. The problem with this is that I don't get an option to select these custom styles. I have to manually type them in.
Neither one of these options gives me the ability to visually pick a banner in the ACP. That's frustrating.

Am I understanding correctly how to have custom banners?
 
Back
Top Bottom