Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2008-01-01 17:22:23

facho
Member
Registered: 2007-04-15
Posts: 64

Article list in sidebar from same category as current article

Ok, so here is the problem I am wrestling with. I have a main article being displayed. On the sidebar of the page (right side), I have a list of the last 5 articles published for people to see in case they are interested in any of them. Those articles though are from EVERY category available. What I want to do, is have the sidebar articles pull up the last five published FROM THE SAME CATEGORY as the main article on the page. Can this be done with TXP?

any help is appreciated.

thanks!

Offline

#2 2008-01-01 17:36:48

iblastoff
Plugin Author
From: Toronto
Registered: 2006-06-11
Posts: 1,197
Website

Re: Article list in sidebar from same category as current article

could be wrong but doesn’t <txp:related_articles /> do this for you?

Last edited by iblastoff (2008-01-01 17:37:46)

Offline

#3 2008-01-01 17:39:31

facho
Member
Registered: 2007-04-15
Posts: 64

Re: Article list in sidebar from same category as current article

it probably does. I am still a struggling newbie at this stuff. I’ll look it up in textbook and see if i can get it to work.

thanks!

Offline

#4 2008-01-01 21:33:43

facho
Member
Registered: 2007-04-15
Posts: 64

Re: Article list in sidebar from same category as current article

So, that does do what i want for the most part. However, I also am trying to pull up the article’s image thumbnail along with the linked title. I’m struggling to get that to consistently work.

I dropped the following into a form hoping it would give me what i need but to no avail:

<txp:related_articles section=“oped” match=“Category1” /><br />
<txp:article_image thumbnail=“1” />

What I get is list of articles with images sporadically displaying. The images are not next to the right article and in a list of 20+ articles only 3 thumbs are showing up.

thoughts on how to make this work?

BTW-love the LD pic. He’s a genius!

Offline

#5 2008-01-01 21:53:29

thebombsite
Archived Plugin Author
From: Exmouth, England
Registered: 2004-08-24
Posts: 3,251
Website

Re: Article list in sidebar from same category as current article

I don’t think those tags will simply connect with each other. If you want to show images as well you will probably need to use a different method something like:-

Create a form called “listarticles” (or whatever you want) with code similar to:-

<li><txp:permlink><txp:title /></txp:permlink> <txp:article_image /></li>

then in your page where you want the list to display:-

<ul><txp:asy_wondertag><txp:article_custom limit="9999" form="listarticles" section="<txp:section />" category="<txp:category1 />" /></txp:asy_wondertag></ul>

Change the form name to whatever you called it. You will also need to install the “asy_wondertag” plug-in.

Last edited by thebombsite (2008-01-01 21:54:20)


Stuart

In a Time of Universal Deceit
Telling the Truth is Revolutionary.

Offline

#6 2008-01-01 21:56:31

facho
Member
Registered: 2007-04-15
Posts: 64

Re: Article list in sidebar from same category as current article

First thank you for taking the time my friend. I love this community. I’ll give it a try and reach out if i run into trouble.

Offline

#7 2008-01-01 22:37:29

facho
Member
Registered: 2007-04-15
Posts: 64

Re: Article list in sidebar from same category as current article

Once I figured out that “<txp:asy_wondertag>” was a plug in, it worked like a charm! THANK YOU FINE SIR!

Offline

#8 2008-01-02 02:49:02

thebombsite
Archived Plugin Author
From: Exmouth, England
Registered: 2004-08-24
Posts: 3,251
Website

Re: Article list in sidebar from same category as current article

No problem. I should have “linked” it for you really. I was in a hurry. ;)


Stuart

In a Time of Universal Deceit
Telling the Truth is Revolutionary.

Offline

Board footer

Powered by FluxBB