XF 2.2 Styles independent from Xenforo

Liam C.

Member
Hello there! Creating a custom addon for a team in where we break out of the page_container

However, we uploaded the addon today to both of our sites and realised that we will need custom themes specifically for this addon. Now the concern here is that these themes will not apply to the rest of our Forums (as well as majority of our community members will not be able to access this style either).

My question is... how would you suggest this to be done behind the scenes? We use about 2-4 styles on the main forums, and this addon would require around 24 styles to be added. These styles shouldn't be accessible to certain users (permission locked) either. We'd also like it that they revert to their normal Forums style when leaving the routes/page_container that they are in.

It's hard to break it down into questions here, as there can be multiple ways this could be done. For e.g. we could create an entirely new styling system in where we save something to the user's preferences for what style they are using for that addon. Or to simply create a new style and find a way to permission lock it.

Preferably, we'd like it not to appear in the /account/preferences route under the normal "Style". If it was possible, or least not difficult to do, I'd like to have a dropdown in the /account/preferences page called "{Addon_name} Style" and have a list of the styles there, and have it apply the styling when going to the addon's routes.


Looking forward to some help here! I understand this might be a bit of an odd idea but any help is much appreciated! Thank you!!
 
Maybe a styles control panel addon. I started to build one that added all kinds of features in it. The basic outline is you could import 100 styles within it using a .xml from each. Then from the control panel you can control any of the special effects for each style. So one style you may want it snowing, while the next one you don't, and so on.

So maybe something like this could work for you.
 
Hm unfortunately that doesn't answer my question! I need to find out essentially if it's possible to have a hidden style that does not affect the main forums, is hidden from the preferences style dropdown and can be applied to certain routes in code
 
So if you have a route called hidden-style, you only want that picked style going to only that? Just making sure I am understanding you right.
 
So if you have a route called hidden-style, you only want that picked style going to only that? Just making sure I am understanding you right.
Uh maybe? Not sure if that's the correct wording.

Essentially we have a custom route prefix, lets call it /Astro/{action} (we have about 20 routes).

Each time a user goes to /Astro, then it uses the hidden style. This hidden style is exclusive to about 40 users (people with set roles / permissions)

This style should be selectable to the user. When they go back to the normal forums, they revert to the style they were originally using


I'm currently considering trying to add another preference and then saving it (somehow, not sure how to save it yet, looking into that next week) and then using that to appear in the page_container's parent class and then a .less template in where the Administrators can add their custom styling there (with a template), as they only need to edit a limited amount of elements for it to function as intended
 
Back
Top Bottom