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

Addon CSS Position?

Discussion in 'XenForo Development Discussions' started by rivacom, Jun 16, 2014.

  1. rivacom

    rivacom Active Member

    Maybe i'm not searching for the right keyword so I apologize if this is already been asked to death.

    Is it possible, via CP addon options or code, to allow users to put in a Div ID to position your addon where they want? Or is there another way to position it?
     
  2. EQnoble

    EQnoble Well-Known Member

    You are asking about an addon which means you should be asking in a specific addon's thread, and you also don't specify what you are talking about applying this to so to be honest until those things are made clear and in the right place you are probably not going to get a real answer.
     
  3. rivacom

    rivacom Active Member

    Sorry I guess maybe I assumed by it being in the development forum it would fill in the blanks. My apologies.

    Say I developed a new theme, I have a new template in that theme called Middle. Now I am developing an addon, I have a addon option for my addon for the user to put in a template they'd like the addon to show up on. But my new template has 3 Divs to divide up the template. I would love the addon to be in the 2nd Div statement, and CSS seems like the best way to do this. But by default, it will insert before the DIV statements. I'd like to give an option somehow for users to position it within their existing or new templates. What would be the best way to go about this?
     
  4. EQnoble

    EQnoble Well-Known Member

    No problem...
    What blanks?

    Wait... a user specifies, or an Admin of that forum using that addon specifies it?

    No if you have data created by an addon and you want it inserted within a specific element you actually need to insert the html and whatever output your addon generates in that div unless you are doing something specific that requires you to do something different than the norm. You use css to finalize positions and stylize things and you shouldn't try to hack something into place with css when you should actually be getting the data where you need it to be and then styling it.

    Again I can't see what you are making or how things are included or what you did so I can not tell you.
     
  5. rivacom

    rivacom Active Member

    Ok, By users, I mean users of the addon, or the forum admins.

    So let's say here is my template.

    HTML:
    <xen:hook name="middle_bar" />
    
    <div class="middleBarLeft"></div>
    
    <div class="middleBarMiddle">
    </div>
    
    <div class="middleBarRight"></div>
    Right now I have a field in the Administration options for my addon for template, So I put in middle_bar, and my addon hooks into middle_bar. However, it's placed before the first Div. Theres no way to allow an admin to position the addon between one of the divs?
     
  6. EQnoble

    EQnoble Well-Known Member

    You should be able to add this anywhere in your template like this ...
    Code:
    <xen:hook name="middle_bar"></xen:hook>
    
     

Share This Page