Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2006-11-28 19:05:37

Charlie Chalk
Member
Registered: 2005-09-06
Posts: 51

put articles from two different sections on the same catagory page

Hi

After much appreciated help from Els in getting as far as I have with this site I have come up against another problem.

I have a range of affiliate adverts I would like to place on each catagory page. My articles (each list entry) are in a section called ‘article’ and my adverts are individual articles filed in a section called ‘advert’.

I thought I could use the Custom Article tag and specify that the page had one article from the ‘advert’ section. By doing this I hoped that the advert that was in the Football catagory would show up on the football page and the advert in the Photography catagory would apear on the photography page, and so on and so on.

When I try and put the custom article tag into the page template (this is the tag – <txp:article_custom allowoverride=“0” form=“Banner” limit=“1” pgonly=“10” section=“advert” status=“4” />) all I get is the last advert added to the site, and that’s the same advert across all catagories.

Is there something I’m doing wrong in the tag above? This is the standard article tag I have for displaying the list info:
<txp:article allowoverride=“0” form=“default-ad” limit=“1” pageby=“10” searchsticky=“0” sort=“Posted desc” status=“4” />

Or is there another way to do what I want?

Any help much appreciated!

CC

Last edited by Charlie Chalk (2006-11-28 19:06:21)

Offline

#2 2006-11-28 19:18:16

Mary
Sock Enthusiast
Registered: 2004-06-27
Posts: 6,236

Re: put articles from two different sections on the same catagory page

article_custom is not context-sensitive, therefore you’ll have to add the category attribute to it directly.

Offline

#3 2006-11-28 19:19:53

Charlie Chalk
Member
Registered: 2005-09-06
Posts: 51

Re: put articles from two different sections on the same catagory page

ah ha! Thanks Mary.

I guess that means I’ll need a series of IF statements to make sure the catagry page shows the correct advert then?

Thinking aloud, and I guess the answer is no, but – can you add the Catagory tag to the article custom tag?

Last edited by Charlie Chalk (2006-11-28 19:20:57)

Offline

#4 2006-11-28 19:30:23

jm
Plugin Author
From: Missoula, MT
Registered: 2005-11-27
Posts: 1,746
Website

Re: put articles from two different sections on the same catagory page

You can try the wondertag. Haven’t tried it myself though.

Offline

#5 2006-11-28 19:55:44

Mary
Sock Enthusiast
Registered: 2004-06-27
Posts: 6,236

Re: put articles from two different sections on the same catagory page

Yes, you’d need a bunch of conditionals, or, as Jon-Michael mentioned, use asy-wondertag. The latter would like this:

<txp:asy_wondertag><txp:article_custom section="advert" category="<txp:page_url type="c" />" /></txp:asy_wondertag>

…can you add the Catagory tag to the article custom tag?

Sorry, what are you asking here?

Offline

#6 2006-11-28 20:00:01

Charlie Chalk
Member
Registered: 2005-09-06
Posts: 51

Re: put articles from two different sections on the same catagory page

I was asking to do exactly what you have done in your example, and it works!

I wondered if it was possible to embed one tag into another, and by the need for the ‘wondertag’ I see the answer is no, not without this plugin.

Anyway, everything working tikety boo!

THanks again for all your help

Offline

Board footer

Powered by FluxBB