Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#1 2011-12-30 22:46:48
- inisheer
- Member
- Registered: 2010-01-20
- Posts: 14
Different Sidebars in Different Sections
I would like to create a new Textpattern site. But I want to have several article sections, each of which has it’s own type of content showing the the sidebar. In other words, I want a section of articles about accounting degrees, with info about accounting degrees in the sidebar, a section about nursing degrees with info about nursing degrees in the sidebar and so forth. It’s easy to do that with an html site in Dreamweaver, but I would prefer to have a real CMS – not sure if this is doable, however. The homepage would be a static page with links to all sections.
Thanks
Bob
Offline
Re: Different Sidebars in Different Sections
That’s definitely possible and there are different ways of going about it depending on the kind of information you’d like to show in the sidebar. By way of example, just two of probably many more options:
Example Scenario A: A section with a series of different articles on topic-x including pagination. Sidebar should show fixed information on topic-x.
Solution: Make the fixed sidebar information an article with “sticky” status in that section. The normal articles in that section have “live” status as default. When you make your page template, show articles with status="sticky"
in the sidebar and use the normal settings (which calls “live” articles and ignores sticky articles) for the main articles.
Example Scenario B: A section with a series of article excerpts on topic-x in list view and a single full article in individual article view. The sidebar should show a list of linked article titles on the same topic.
Solution: Use the standard txp:article tag for the main articles – this is context sensitive meaning that it will show either a list or an individual article from the current section depending on the url. For the sidebar use txp:article_custom along with the section
attribute to call in a specific list of articles from that section – unlike txp:article, txp:article_custom ignores the current context so you can use it to request specific articles.
TXP Builders – finely-crafted code, design and txp
Offline
#3 2011-12-31 11:05:00
- jelle
- Member
- Registered: 2006-06-07
- Posts: 165
Re: Different Sidebars in Different Sections
In a similar scenario I’m using the atb_if_form plugin to get section specific content where needed and glz_custom_field to designate certain articles to the sidebar with a checkbox.
Offline
#4 2011-12-31 18:05:02
- inisheer
- Member
- Registered: 2010-01-20
- Posts: 14
Re: Different Sidebars in Different Sections
Thanks guys. I’ll start working into these and see what works best. Jakob I think your scenario B is what I’m looking for. This will take a little time as I haven’t really worked in this CMS for awhile. Thanks again.
Offline
Re: Different Sidebars in Different Sections
You could also use this technique to include content of one article, in another article based of specific custom field values… your description of accounting degrees would be a separate article, the content of which is depicted in the sidebar (or where ever) in another article when you enter en certain key value in one of the custom fields, see explanation here: http://forum.textpattern.com/viewtopic.php?pid=256217
Offline
#6 2012-01-09 21:29:50
- inisheer
- Member
- Registered: 2010-01-20
- Posts: 14
Re: Different Sidebars in Different Sections
After looking over all your comments, I think I need to do a better job of asking this question clearly. You’ve given me some good pointers, but I think I need a bit more info for exactly what I’m seeking. The site setup I need for what I want to accomplish is (I realize this will require a theme that sets up into three columns):
Site home page is a static page / updated manually only
Site is divided into multiple sections that link to the home page nav bar.
Imagine section A and section B. Pages in each section have a standard well for article content the center and a sidebar on either side of the article content. In all articles in section A, both sidebars show content that is unique to section A, and in all section B articles, the sidebars show content that is unique to section B.
These sidebars accept HTML manually put in – they are not automatically updated to show most recent articles or anything like that. The only automation is that when a sidebar in section A is changed, the change is updated to that sidebar in all article pages in section A only.
This is actually very easy to accomplish on an html site done in Dreamweaver (example here: http://www.successdegrees.com/ ). But that’s a pain because you can only update from a computer with Dreamweaver on it and all your page files stored. I’d rather do it with a CMS if possible.
Let me know if this is understanble and if you think this concept is feasible in Textpattern.
Thanks again for all your help!
Bob
Offline
Re: Different Sidebars in Different Sections
Well, that sounds a bit like my example scenario A above but with two sidebars rather than just one. That complicates things a little bit, but only a little bit. Here’s one way to solve it based on example A above:
For your section A, create an article for each sidebar with the fixed content you want there and assign each of them the status “Sticky”. Create your other articles for that section that will show in your main content column as normal “live” articles. You should have something like this:
- Section A Sidebar left (Sticky)
- Section A Sidebar right (Sticky)
- Section A Article one (Live)
- Section A Article two (Live)
- …
Now in your page template follow this rough schematic pattern:
<div id="sidebar_left">
<txp:article_custom section='<txp:section />' status="sticky" limit="1">
<!-- sidebar content from first sticky article in this section -->
<txp:body />
</txp:article_custom>
</div>
<div id="main">
<txp:article form="my-individual-article-form" listform="my-article-shortlist-form" />
</div>
<div id="sidebar_right">
<txp:article_custom section='<txp:section />' status="sticky" offset="1" limit="1">
<!-- sidebar content from second sticky article in this section -->
<txp:body />
</txp:article_custom>
</div>
You’ll probably need to change this slightly to match your setup, but the basic principle is that you use the standard txp:article tag for the normal content in the main column, and for left sidebar you grab the first sticky article in the section (using the attribute limit="1"
), and for the right sidebar you grab the second sticky article (actually show one article after skipping the first one using the attributes limit="1" offset="1"
).
If you need to go back and change the content for the sidebar, just edit the respective article and it will update for all the pages in that section.
TXP Builders – finely-crafted code, design and txp
Offline
#8 2012-01-09 22:41:08
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: Different Sidebars in Different Sections
inisheer wrote:
Let me know if this is understanble and if you think this concept is feasible in Textpattern.
Yes and yes. Easily. We can tell you how and which tags to use right now, but if you haven’t set the site up yet, it probably won’t make much sense to you at the moment. But believe me, what you want is more or less what Textpattern does out of the box.
Edit: ha, sorry I’m late :) But Julian, I think we won’t need much more here than our wonderful context sensitive <txp:article />
tag.
Last edited by els (2012-01-09 22:43:36)
Offline
#9 2012-01-10 17:26:47
- inisheer
- Member
- Registered: 2010-01-20
- Posts: 14
Re: Different Sidebars in Different Sections
Guys, that sounds great. I’m gonna have to work my way into this gradually – this is a site that hasn’t launched yet. While we’re talking, do either of you guys do basic coding for sites like this? I’m just so busy creating the content I’m afraid it’s gonna take me a long time to dig into this CMS again. Hope I’m not breaking the rules of the forum by putting out a possible job here.
Bob
Offline
Re: Different Sidebars in Different Sections
do either of you guys do basic coding for sites like this
Sure, we both do, but to be fair quite a few txp regulars do too and there is a seeking txp pros forum especially for this where more people may see your request.
But Julian, I think we won’t need much more here than our wonderful context sensitive <txp:article /> tag
Els, yes, there are lots of potential ways. Care to share yours too? I’m always interested in learning other ways.
TXP Builders – finely-crafted code, design and txp
Offline
#11 2012-01-10 21:44:30
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: Different Sidebars in Different Sections
jakob wrote:
Els, yes, there are lots of potential ways. Care to share yours too? I’m always interested in learning other ways.
Ah, er… I’m afraid I replied too fast. Wouldn’t work on individual article pages of course.
Offline
#12 2012-01-11 15:59:24
- inisheer
- Member
- Registered: 2010-01-20
- Posts: 14
Re: Different Sidebars in Different Sections
Well, you’ve already put some effort into this so I’m inclined to try it with you. It sounds to me like a fairly basic job, though I think I need to assemble some deliverables – choosing a theme for starters – to get started. If you’d like to talk via email ping me at publisher@irishletter.com
Offline