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

set sidebar to true with php bit

Discussion in 'Resource and Add-on Discussions' started by brstrm, Jul 24, 2013.

  1. brstrm

    brstrm Active Member

    Hello all,

    I'm working on a site design that aesthetically requires the presence of a sidebar on every page.

    I am wondering if there is that would enable a global sidebar on every page. I've done a quick google and am unable to find any pre-existing plug-in..................................

    EDIT: Changed my mind. Not interested in a plug-in. Now I am wondering if there exists a php bit which would allow me to set sidebar to true on all pages. It would be nice to be able to toggle this within the style properties as I could incorporate it into my own xenforo framework.
     
    Last edited: Jul 24, 2013
  2. thumped

    thumped Well-Known Member

  3. brstrm

    brstrm Active Member

    Changed my mind. Not interested in a plug-in. Now I am wondering if there exists a php bit which would allow me to set sidebar to true on all pages. It would be nice to be able to toggle this within the style properties as I could incorporate it into my own xenforo framework.
     
  4. Jeremy

    Jeremy XenForo Moderator Staff Member

    Sidebars are added per page using the xen:sidebar tag. Supporting data is added in via PHP. You'll need to edit templates + create an add-on.
     
  5. Mike Creuzer

    Mike Creuzer Well-Known Member

    Code:
    So, there is no way to just do <xen:parse $sidebar = 1; </xen:parse> or something?
     
  6. xf_phantom

    xf_phantom Well-Known Member

    Code:
    <xen:sidebar>
    your content for the sidebar
    </xen:sidebar>
    
     
  7. Mike Creuzer

    Mike Creuzer Well-Known Member

    That requires a template edit on each page, right? Or, I guess I can just define a default sidebar inside PAGE_CONTAINER, correct?
     
  8. xf_phantom

    xf_phantom Well-Known Member

    Sorry, i didn't notice that you're also talking about a global sidebar.
    i've tried to add it too, but xenforo isn't designed to have a global sidebar:(

    You can do it via the event system and use templatePostRender
    PHP:
    $containerData['sidebar'] = $template->create('my_global_sidebar'); )
    but there are some problems..:/
    See this post for more informations: http://xenforo.com/community/threads/global-sidebar.53928/#post-577822
     
    Last edited: Jul 25, 2013
    Mike Creuzer likes this.
  9. Mike Creuzer

    Mike Creuzer Well-Known Member

    The thread ends with you talking about PAGE_CONTAINER template. Did that end up working for you?

    XenForo has a default sidebar. Staff Online Now, Online Now, Forum Statistics, etc. I just want to show that, all the time, and any other sidebars can overwrite that.
     
  10. Jeremy

    Jeremy XenForo Moderator Staff Member

    You'll need a plugin for that. Its added in via xen:sidebar and the data isn't fetched on each page.
     

Share This Page