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

XF 1.2 how to create option for selection style for my addon?

Discussion in 'XenForo Questions and Support' started by Ombre, Feb 2, 2014.

  1. Ombre

    Ombre Member

    Hello,

    I created an addon, it works, but it n'à no option in the admincp, I wish there was an option for it to work on some of my styles, would you ideas, or a tutorial? Thank you.
     
  2. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    An option where exactly? Can you provide more information?
     
  3. Ombre

    Ombre Member

    Here, I made a template change, with the creation of a template for the CSS, and I want that does not apply to all styles, because I'm going to share this with the community XenForo addon, but I do not know how to have the options XenForo an option for this addon to act on the desired styles. Do you have an idea, or a track that I could look me? Thank you in advance.
     
  4. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Example:

    Code:
    $visitor = XenForo_Visitor::getInstance();
    
    if ($visitor['style_id'] == 4)
    {
    	// THEN YOUR CSS
    }
    
    The visitor object contains all information for the current logged in user, including the style they are using.
     
  5. Ombre

    Ombre Member

    Hello,

    Sorry for my late reply, I was away, In your example, I see that vou sutilisais a condition, I want the administrators this addon can choose the style or if it will work this addon have plsueiurs, they will not necessarily use it for all, what is the solution please?

    I give you an example picture.

    http://prntscr.com/2sn7q6

    Thank you to you.
     

Share This Page