1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Advanced Styling Rules v1.0.4

This add-on offers an advanced styling system that allows you to assign specific styles to any page

  1. alexD

    alexD Well-Known Member

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

    - 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.
    Anthony Parsons, ShadyX, Pras and 4 others like this.
  2. alexD

    alexD Well-Known Member

    This post will be getting updates from time to time with additional information and maybe some FAQs.

    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.png
    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)
    example_part0.png example_part1.png example_part2_validation.png example_part3.png example_part4_rule.png example_part5.png
    In the above screenshots you can see how to assign a specific style (in our case Black n' White) to a specific thread.
    ShadyX and yavuz like this.
  3. Floris

    Floris Guest

    Excellent work, nice job AlexD.
  4. alexD

    alexD Well-Known Member

    Thanks Floris!!
  5. Morgain

    Morgain Well-Known Member

    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?
  6. alexD

    alexD Well-Known Member

    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.
  7. Brogan

    Brogan XenForo Moderator Staff Member


    FYI, it's better to use Report for stuff like this so it doesn't get overlooked.
    alexD likes this.
  8. alexD

    alexD Well-Known Member

    v1.0.1 Changelog:
  9. Calamity James

    Calamity James Active Member

    What a useful add-on this is. Works perfectly with the Mobile style to get users onto something a bit more friendly! :)
    alexD likes this.
  10. Calamity James

    Calamity James Active Member

    ...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:
  11. alexD

    alexD Well-Known Member

    I'll try to find a workaround, thanks for reporting!
    You'll need to wait till I get a friend's smartphone though.
  12. Calamity James

    Calamity James Active Member

    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
    echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n".(xmlresperror("Server error occurred: '{$error['message']} (".basename($error['file']).":{$error['line']})'")->serialize('UTF-8'));                
    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 :)
  13. alexD

    alexD Well-Known Member

    @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 :)

    Attached Files:

    • fix.zip
      File size:
      2.6 KB
    Calamity James likes this.
  14. Calamity James

    Calamity James Active Member

    Superb, that's fixed it! :D

    Thanks so much! Donation coming your way! :)
    alexD likes this.
  15. alexD

    alexD Well-Known Member

    cool, thanks :)
  16. alexD

    alexD Well-Known Member

    Calamity James likes this.
  17. Morgain

    Morgain Well-Known Member

    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?
  18. alexD

    alexD Well-Known Member

    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.

    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.

    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.
  19. Digital Doctor

    Digital Doctor Well-Known Member

    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 ?
  20. alexD

    alexD Well-Known Member

    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.
    Digital Doctor likes this.

Share This Page