Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2010-05-28 15:01:29

caruso_g
Member
From: Catania
Registered: 2009-04-11
Posts: 88
Website

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

#2 2010-05-28 16:38:38

floodfish
Member
From: Brooklyn, NY
Registered: 2007-01-11
Posts: 155
Website

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

#3 2010-05-28 16:56:05

caruso_g
Member
From: Catania
Registered: 2009-04-11
Posts: 88
Website

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

#4 2010-05-28 17:04:29

floodfish
Member
From: Brooklyn, NY
Registered: 2007-01-11
Posts: 155
Website

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

#5 2010-05-28 17:11:24

MattD
Plugin Author
From: Monterey, California
Registered: 2008-03-21
Posts: 1,254
Website

Re: Manage sidebar through an article

How about combine the two? That way the sticky articles won’t show in your normal listing.


My Plugins

Piwik Dashboard, Google Analytics Dashboard, Minibar, Article Image Colorpicker, Admin Datepicker, Admin Google Map, Admin Colorpicker

Offline

#6 2010-05-28 17:13:38

floodfish
Member
From: Brooklyn, NY
Registered: 2007-01-11
Posts: 155
Website

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

#7 2010-05-28 17:20:31

caruso_g
Member
From: Catania
Registered: 2009-04-11
Posts: 88
Website

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

#8 2010-05-28 17:21:42

MattD
Plugin Author
From: Monterey, California
Registered: 2008-03-21
Posts: 1,254
Website

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)


My Plugins

Piwik Dashboard, Google Analytics Dashboard, Minibar, Article Image Colorpicker, Admin Datepicker, Admin Google Map, Admin Colorpicker

Offline

#9 2010-05-28 17:26:42

caruso_g
Member
From: Catania
Registered: 2009-04-11
Posts: 88
Website

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

#10 2010-05-28 17:28:05

floodfish
Member
From: Brooklyn, NY
Registered: 2007-01-11
Posts: 155
Website

Re: Manage sidebar through an article

Yeah, that ought to work. I think all three of us are saying the same thing now :)

Offline

#11 2010-05-28 17:28:20

caruso_g
Member
From: Catania
Registered: 2009-04-11
Posts: 88
Website

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

Board footer

Powered by FluxBB