Resource icon

Advanced Styling Rules for XF1 v1.0.4

No permission to download

alexD

Well-known member
DaTheme.webp— Advanced Styling Rules SetStyleForX
This add-on offers an advanced styling system that allows you to assign specific styles to any page you like.
search_specific_rule_with_expanded_menu_and_info_box.webp

- You may find it useful if:
  • you have any site locations (like often visited/popular threads) that could get some extra love
  • you need to apply different styles for different devices and/or systems
  • you own more than one domain that points to one XenForo installation and could use different styles for each one (please make sure you don't violate the terms in the XenForo License Agreement) [1]
  • you are a style designer who likes the idea of displaying sneak peaks from your alpha/beta-stage designs (something that could possibly result in valuable feedback)
  • you would like to display custom pages/messages/advertisments for specific search terms
! Please consider donating if you use this add-on.
....................
 
This post will be getting updates from time to time with additional information and maybe some FAQs.
------------------------------------------------------------------------------------------------------------------------------------------------------

FAQ
What is the Validation step I see every time I try to create a new rule?
-It's a feature that aims to automate the URL splitting process. It requires the adminCP URL to have the same scheme, host and base (XenForo installation) path with the inserted one.
---------------------------------------------------------------------------------------------------------------
I can move the rules up and down, why?
-The rules nearest the top have higher priority than the following ones.
---------------------------------------------------------------------------------------------------------------
I can not find the control panel, what's wrong?
-Only Super Admins and administrators that have the "Manage styles, style properties, and templates " permission are allowed to use this add-on.
-
- adminCP_location.webp
---------------------------------------------------------------------------------------------------------------
How exactly the rules and sub-rules are structured?
  • Main Rule
    • URI
      • Scheme
      • Host
      • Base Path: the path of your XenForo location, if any
      • Rest Path: the remaining path (full path - base path)
      • Query
    • Device
      • Browser
      • is.Mobile
      • User Agent regular expression
    • User
      • User Id(s)
      • IP(s)
      • User Group(s)
    • Style(s)
Screenshots
example_part0.webp example_part1.webpexample_part2_validation.webpexample_part3.webpexample_part4_rule.webpexample_part5.webp
In the above screenshots you can see how to assign a specific style (in our case Black n' White) to a specific thread.
 
Sorry - don't get this at all. Does this affect the URL? the tabs? the breadcrumbs? or the content of the page?

How about example screenshots?
 
Sorry - don't get this at all. Does this affect the URL? the tabs? the breadcrumbs? or the content of the page?

How about example screenshots?
Hi there,

This add-on affects the whole displayed style by taking into account any rules set by the administrator, let them be URLs, User Groups or any combination from this list.

For example you could create a rule that would display a random style from a set of selected ones to visitors/members browsing from an iPhone. That rule would require the following settings:

set Browser to 'WebKit'
set isMobile to 'Yes'
check multiple styles

...you could also provide a regular expression for the user agent in the browser category instead.

It's a really unique add-on, a cool feature that only exists for XenForo.
 
...Ooops! Just noticed it seems to break Tapatalk integration (seems fine with Forum Runner though)

This is what I see on Tapatalk when I try to connect:
O55dC.webp
 
I'll try to find a workaround, thanks for reporting!
You'll need to wait till I get a friend's smartphone though.
If you just install the Tapatalk plugin, and point your browser to /mobiquo/mobiquo.php on your forums there is a base64 encoded version of the error message there. (My site for example)

In fact, if you edit line 41 of /mobiquo/mobiquo.php from
Code:
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n".(xmlresperror("Server error occurred: '{$error['message']} (".basename($error['file']).":{$error['line']})'")->serialize('UTF-8'));
to
Code:
echo "Server error occurred: '{$error['message']} (".basename($error['file']).":{$error['line']})'";

It should just echo out the un-encoded error, without the need to access it on a smartphone :)
 
@Calamity James As I don't have a personal forum included in the tapatalk database to test with, check if the attachment included in this post fixes the issue. If it does, I'll update the main add-on with the fix :)
 

Attachments

So if I want a dedicated Category page, or a specific forum list page, or a usergroup set of Profile pages - I could assign a certain design to a unique page? or to a group of pages?
 
So if I want a dedicated Category page, or a specific forum list page, or a usergroup set of Profile pages - I could assign a certain design to a unique page? or to a group of pages?
Think of it like this. In your post, you' re talking about 3 pages. Every page has a URL. If we wanted to assign a certain style to a page, we' d use the URI sub-rules and create a main rule for that page.

example_1.webp
Here, I am creating a URI-only based rule with a specific style assigned to my profile page, any visitor browsing that page will see that specific style.

Let's say I don't want everyone to see my cool user profile style, but only a few trusted members of a specific User Group, let's say Moderators.
I'll need to select/check that User Group inside the User Group sub-rule field.
example_2.webp

If I wanted my Moderators to see that style only by browsing from a mobile device I would set the isMobile sub-rule to 'Yes'.

Notice the asterisk on the right side of the User Group label. As we haven't yet checked a group, that asterisk notifies us that the User Group criteria will not be checked to assign the style.
 
This seems to create the opportunity for Style creators to make xenforo even better.
If I bought a Style from DesignerX ... how would they also include page / node / URL specific styles ?
Would they send me an .xml file and I would upload it ?
Is it not possible ?
 
This seems to create the opportunity for Style creators to make xenforo even better.
If I bought a Style from DesignerX ... how would they also include page / node / URL specific styles ?
Would they send me an .xml file and I would upload it ?
Is it not possible ?
A designer needs to create a separate style and send you the .xml file. The only one who can assign that style to a specific page / node / URL is you.
 
Top Bottom