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

Sidebar on a select forum

Discussion in 'XenForo Questions and Support' started by Dynamic, Feb 19, 2013.

  1. Dynamic

    Dynamic Well-Known Member

    Hey guys,

    I would like to know how I would go about adding a sidebar on a certain forum. Aside from the sidebar being on the forum home, I would like it on certain other forums but not every forum. Also, the sidebar will be a custom sidebar, not like the one on the forum home, but one with custom content.

    Any help would be great.

  2. Morgain

    Morgain Well-Known Member

    I can't give you the package but I can do some pointers.

    You can make a custom sidebar and insert it on selected types of pages eg forum home, or Category or Forum view.

    You Create Template (button top right on any template page).
    You can use the same containers as the XF sidebar uses (I'll dig that out for you if you need it)
    Or make your own - in EXTRA.css or an additional css that you link to the custom sidebar template.
    The sidebar template itself is inserted in another page like this:
    <xen:include template="myname_sidebar">
    Name it with your actual name - makes it easy to find it later. Ditto if you make your own css.

    To have it display only on certain forums you make a conditional using the forum ID number
    If this forum is forum_54 show Myname_sidebar
    The ID number shows in the address bar for that forum.

    I have something like this to display a colour theme and title image per category node. But I did not code it myself. Jake Bunce, maybe Shelley and Slavik, and Chris Deeming are all good design coders in my experience. I expect one or more of them will come and help on this soon.
    Dynamic likes this.
  3. Dynamic

    Dynamic Well-Known Member

    Hi Morgain,

    Thanks heaps for that :D I am not a coder, but I will try and follow what you said and see if I can get it to work. Thanks heaps for replying :D

  4. Morgain

    Morgain Well-Known Member

  5. Dynamic

    Dynamic Well-Known Member

    Okay, so. I copied the contents of the sidebar template and made a new template named dynamic_sidebar. I then pasted the code into that template.

    Then I went to page container and added this code under the normal sidebar.

    <xen:if is="$forum.node_88}">
    <xen:include template="myname_sidebar"> </xen:include>

    It did not work. Or am I missing something? (sorry dude, I am not a programmer)
  6. Dynamic

    Dynamic Well-Known Member

    Ah cool

    Thanks Morgain! You are a champ :)
    Morgain likes this.
  7. Dynamic

    Dynamic Well-Known Member

    Well that's me done. Almost threw the monitor through the window. Anyone wanna show me how this is done? I keep getting errors and nothing is working :(
  8. Dynamic

    Dynamic Well-Known Member

    Does anyone have any solution to this. What I am trying to do is get a specific node to display a custom sidebar (for navigation). I have no clue what I am doing and everything I tried got the forum to spit errors at :(
  9. EQnoble

    EQnoble Well-Known Member

    start a convo with me if you still need help
  10. Jon W

    Jon W Well-Known Member

    You need to be careful that your brackets match... for starters, your first line has a closing } bracket but not an opening one.

    In the forum_view template, $forum is an array containing all the information about the forum currently being viewed. The ID of the node is $forum.node_id, so you want:
    <xen:if is="{$forum.node_id} == 88">
        <xen:include template="dynamic_sidebar" />
    Your dynamic_sidebar template should then look something like this:
        <!-- your sidebar HTML goes here -->
    Alternatively, you would put the following in forum_view template:
    <xen:include template="dynamic_sidebar" />
    and move the conditional code to your dynamic_sidebar template:
    <xen:if is="{$forum.node_id} == 88">
            <!-- your sidebar HTML goes here -->

    Hope this helps.

    I usually tell people who PM me with problems like this to make them public. Hopefully the above answer will help other people too.

    As Shan says:
    zooki likes this.
  11. EQnoble

    EQnoble Well-Known Member

    I usually don't. I do what I do for specific reasons. I also don't handle things that way, it is the person who I am helping that would be responsible to share the information.

    If I help someone with something it is on my terms.

    I was going to make a simple addon out of it for him but you handle this one your way.
  12. Jon W

    Jon W Well-Known Member

    It's no-one's responsibility to share the information... it's just a nice thing to do.

    That would still be a useful thing to do. I think it is better to have these things as add-ons rather than direct template edits whenever possible.

    There is a good tutorial here:
  13. EQnoble

    EQnoble Well-Known Member

    Exactly...so you are calling me out when it isn't my responsibility to help or share...why?

    I choose to do it my way before your response made me choose to not do it at all.

    You saying it is a nice thing to do implies that what I was doing was not nice, watering down the value of free help I was willing to give...so like I said...you can make that addon now for him...I am sure he will appreciate it.

    As far as useful, I didn't need you to tell me it was useful, that's why I was doing it...he needed something; I was going to do it...that it textbook useful.

    So nevermind, you help him...I am jobless, broke, and hungry at this point and I should be doing things that will put food on my table and pay the bills anyways, not dealing with people questioning my personal motives and methods through the path of my life while I am offering my time to others for nothing in return.

    Have fun, you probably have some work to do over here now.
  14. Jon W

    Jon W Well-Known Member

    Surely it doesn't take any longer to post publicly than to post in private, but more people benefit? That was all that I was suggesting. In fact, I don't think I even suggested anything... was just pointing out what I do and why.

    No, that does not imply that at all.

    You said "I was going to make a simple addon out of it for him but you handle this one your way.". I read from that that you now thought your offering was of no or little use, so I was just letting you know that it is still of some use. Of course, it would have been more useful had I not posted my answer. But then, has anyone even checked to see what I posted is correct? Now there's an interesting assumption...

    I like that you want to help people and I don't want my comment to stop you from helping people. I would suggest that you are not always getting nothing in return, but then I obviously don't want to see you starve either.

    Sure do. Busy, busy.
  15. EQnoble

    EQnoble Well-Known Member

    Please just stop now...if you weren't suggesting anything....why were you making a comment of how I choose to do what I (key word here) choose to do?

    Yes it does...otherwise what you said about what you do had no point

    No ...what you should have read was since you have a problem with the way I was helping him privately...that you should go right on ahead and help him publicly since you are so concerned with that aspect of HIM getting help...nevermind that he can repost the info later...once HIS problem has been solved. Does no one value one on one help anymore?

    You don't know me enough to care if I starve, you also dont care enough to leave someone alone who is trying to help someone....since you insist on changing how I was going to do things... again....I leave you the task of filling my offer to the poor gent in this thread, who now I have no motivation to help.

    Then you should spend less time telling me what you do after I do something like it is a comparison to put me on the stand...
  16. ManOnDaMoon

    ManOnDaMoon Well-Known Member

    Back on topic :

    Someone correct me if I'm wrong, but I believe you can do just this with XenPorta http://xenforo.com/community/resources/8wayrun-com-xenporta-portal.90/ . The forum layouts let you chose a forum ID on which to apply a sidebar.

    In AdminCP Home > XenPorta > Options : tick "Forum (forum-# > forum)"

    then in AdminCP Home > XenPorta > Layouts : select behavior "forum-##" with your forum ID, click customize and add blocks in sidebar (right-hand column).

    This should do what you want.
    Jon W likes this.
  17. Jon W

    Jon W Well-Known Member

    I'm not trying to do anything other than stop you from not helping people because of something that I said that (I think) you have misinterpreted. In my opinion, that is worth taking a little bit of time out of my day to try and sort out, because you clearly know your way around XenForo and it would be a great loss if you stopped helping people out.

    Your help is appreciated. You must know that.

    Personally, I think posting in public is a better way to help more people. I don't even know what your argument is, but please go ahead helping people in private because I'd rather you do that than not help at all.
  18. Dynamic

    Dynamic Well-Known Member

    Thanks heaps for the help guys. The code Waindigo put up totally worked!

    Thanks again!
    Jon W likes this.

Share This Page