Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
Manage sidebar through an article
Hi folks,
I would like to manage the sidebar content through an article of the current section, but I don’t know how to only select the article related to the sidebar and to filter it from the other article list on the page… :/ I hope I was able to explain, I am sorry if not.
Any solution?
Thanks in advance for your help.
Offline
Re: Manage sidebar through an article
You may want to make a sticky article for each section and use that?
Or pull them manually something like this
<txp:if_section name=“foo”><txp:article_custom id=“123” /></txp:if_section>
<txp:if_section name=“bar”><txp:article_custom id=“234” /></txp:if_section>
Offline
Re: Manage sidebar through an article
Hi floodfish,
thanks for your reply.
Sadly, I already used a sticky article for the section landing page and I would like not to hard code the article id to let the client add pages freely without need to edit the template.
Is there a way to get all articles that are not, e.g., of a sub-category “sidebar” or that don’t have set a custom field “sidebar” so that I can just create the normal list and just set that article in the sidebar?
Or could be I can just create a second sticky article and use offset=1
?
Thanks again
Offline
Re: Manage sidebar through an article
Is there a way to get all articles that are not, e.g., of a sub-category “sidebar” or that don’t have set a custom field “sidebar” so that I can just create the normal list and just set that article in the sidebar?
perhaps
<txp:article_custom section='<txp:section />' category="sidebar" />
or
<txp:article_custom section='<txp:section />' custom_field_sidebar="sidebar_yes" />
Or could be I can just create a second sticky article and use offset=1?
That might work, but can you be sure they’ll be in the correct order?
Offline
Re: Manage sidebar through an article
How about combine the two? That way the sticky articles won’t show in your normal listing.
Piwik Dashboard, Google Analytics Dashboard, Minibar, Article Image Colorpicker, Admin Datepicker, Admin Google Map, Admin Colorpicker
Offline
Re: Manage sidebar through an article
How about combine the two? That way the sticky articles won’t show in your normal listing.
Quite right! So:
<txp:article_custom section='<txp:section />' category="sidebar" status="sticky" />
or
<txp:article_custom section='<txp:section />' custom_field_sidebar="sidebar_yes" status="sticky" />
You could even throw a limit="1"
in there if you’re feeling paranoid.
Offline
Re: Manage sidebar through an article
Sorry Jason, I just didn’t notice your name after the nickname.
perhaps
<txp:article_custom section='<txp:section />' category="sidebar" />
or
<txp:article_custom section='<txp:section />' custom_field_sidebar="sidebar_yes" />
Yep, I know that, but I don’t know how to avoid that same article (the sidebar one) to appear to the list of article of the same main section I have on the same page.
That might work, but can you be sure they’ll be in the correct order?
I am using the article order plugin, but I would say the client to create first the landing page and then the sidebar one.
Offline
Re: Manage sidebar through an article
I would go with
<txp:article_custom section='<txp:section />' category="sidebar" status="sticky" limit="1"/>
for the sidebar and
<txp:article_custom section='<txp:section />' category="landing" status="sticky" limit="1" />
for the landing pages
Last edited by MattD (2010-05-28 17:22:11)
Piwik Dashboard, Google Analytics Dashboard, Minibar, Article Image Colorpicker, Admin Datepicker, Admin Google Map, Admin Colorpicker
Offline
Re: Manage sidebar through an article
<txp:article_custom section='<txp:section />' category="sidebar" status="sticky" />
or
<txp:article_custom section='<txp:section />' custom_field_sidebar="sidebar_yes" status="sticky" />
Ok, so, to separate landing pages from sidebar contents:
<txp:article_custom section='<txp:section />' category="sidebar" status="sticky" />
and
<txp:article_custom section='<txp:section />' category="lading-page" status="sticky" />
Right?
Offline
Re: Manage sidebar through an article
Yeah, that ought to work. I think all three of us are saying the same thing now :)
Offline
Re: Manage sidebar through an article
MattD wrote:
I would go with
<txp:article_custom section='<txp:section />' category="sidebar" status="sticky" limit="1"/>
for the sidebar and
<txp:article_custom section='<txp:section />' category="landing" status="sticky" limit="1" />
for the landing pages
Thanks Matt, you was quicker. :)
I am going to test it, thank you both again.
Offline
Pages: 1