Sidebar on a select forum

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.

Thanks.
 
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:
Rich (BB code):
<xen:include template="myname_sidebar">
</xen:include>
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.
 
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

Thanks.
 
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>
</xen:if>

It did not work. Or am I missing something? (sorry dude, I am not a programmer)
 
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 :(
 
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 :(
 
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>
</xen:if>

It did not work. Or am I missing something? (sorry dude, I am not a programmer)
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:
HTML:
<xen:if is="{$forum.node_id} == 88">
    <xen:include template="dynamic_sidebar" />
</xen:if>

Your dynamic_sidebar template should then look something like this:
HTML:
<xen:sidebar>
    <!-- your sidebar HTML goes here -->
</xen:sidebar>

Alternatively, you would put the following in forum_view template:
HTML:
<xen:include template="dynamic_sidebar" />
and move the conditional code to your dynamic_sidebar template:
HTML:
<xen:if is="{$forum.node_id} == 88">
    <xen:sidebar>
        <!-- your sidebar HTML goes here -->
    </xen:sidebar>
</xen:if>


Hope this helps.

start a convo with me if you still need help
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:
Listen - your questions don't only help you - they help others who learn from the answers as well.
 
I usually tell people who PM me with problems like this to make them public. Hopefully the above answer will help other people too.

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.
 
I also don't handle things that way, it is the person who I am helping that would be responsible to share the information.
It's no-one's responsibility to share the information... it's just a nice thing to do.

I was going to make a simple addon out of it for him but you handle this one your way.
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:
http://xenforo.com/community/resources/how-to-add-a-new-sidebar-in-the-forum-list.308/
 
It's no-one's responsibility to share the information... it's just a nice thing to do.

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

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.

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.
No, that does not imply that at all.

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

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

Have fun, you probably have some work to do over here now.
Sure do. Busy, busy.
 
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.
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?

No, that does not imply that at all.
Yes it does...otherwise what you said about what you do had no point

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



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


Sure do. Busy, busy.

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...
Goofus_and_Gallant_by_oogaa.webp
 
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.
 
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?
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.
 
Top Bottom