Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2007-01-09 22:47:30

mattmikulla
Member
From: Nashville Tennessee
Registered: 2004-08-25
Posts: 281
Website

How do I mimic rss_suparchive_bycat using textpattern conditionals?

Oh my photography page I output a list of articles in thumbnail form. When you click a thumbnail you go to that article. In the sidebar only thumbnails within the current article section category are displayed. How can I achieve this using conditionals and not the plug in.

Here is what it looks like at my site . Click on any of the thumbnails.

Here is the code using the plugin
———————————————————————————-
<code>
<txp:if_individual_article>
<h2>Choose an Image</h2>
<div class=“thumb_container”>
<txp:rss_suparchive_bycat section=“photography” useartcat1=“1” showcats=“0” showcatcount=“0” formwraptag=“ul” form=“article_thumbs” />
</div>
<txp:else />
<h2>Recent Photographs</h2>
<div class=“thumb_container”>
<ul>
<txp:article_custom section=“photography” limit=“6” form=“article_thumbs” />
</ul>
</div>
</txp:if_individual_article>
</code>

article_thumbs form
——————————————————————
<li>
<a href=”<txp:permlink />” title=”<txp:title />” class=“innerborder”><txp:bau_article_thumb /></a>
</li>

Last edited by mattmikulla (2007-01-11 02:39:32)


Art Rogue – Fine Art Photography

Offline

#2 2007-01-11 02:31:59

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

Re: How do I mimic rss_suparchive_bycat using textpattern conditionals?

Not sure how you’re articles are setup (never used suparchive before), but I’d try something like this (backup your current template).

<txp:if_individual_article>
	<h2>Choose an Image</h2>
	<div class="thumb_container">
		<ul>
			<txp:article form="article_thumbs" limit="30" />
		</ul>
	</div>
<txp:else />
	<h2>Recent Photographs</h2>
	<div class="thumb_container">
		<ul>
			<txp:article_custom section=“photography” limit=“6” form=“article_thumbs” />
		</ul>
	</div>
</txp:if_individual_article>

Form: article_thumbs

<li>
	<a href="<txp:permlink />" title="<txp:title />" class="innerborder">
		<txp:article_image thumbnail="1" />
	</a>
</li>

Offline

#3 2007-01-11 02:43:43

mattmikulla
Member
From: Nashville Tennessee
Registered: 2004-08-25
Posts: 281
Website

Re: How do I mimic rss_suparchive_bycat using textpattern conditionals?

Sorry. I had a typo in my original post. I had the word section (strike though) and I meant category.

I want to display the article list associated with the current article category. If I am displaying an individual article with the category1 of landscape I want to list all articles with a category1 of landscape in my sidebar.


Art Rogue – Fine Art Photography

Offline

#4 2007-01-11 03:05:02

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

Re: How do I mimic rss_suparchive_bycat using textpattern conditionals?

Try one of these methods (tested locally with a few articles – hopefully it works):

With a plugin – download and activate asy_wondertag

<txp:if_individual_article>
	<h2>Choose an Image</h2>
	<div class="thumb_container">
		<ul>
			<txp:asy_wondertag>
				<txp:article_custom form="article_thumbs" limit="6" category="<txp:category1 />" />
			</txp:asy_wondertag>
		</ul>
	</div>
<txp:else />
	<h2>Recent Photographs</h2>
	<div class="thumb_container">
		<ul>
			<txp:article_custom section="photography" limit="6" form="article_thumbs" />
		</ul>
	</div>
</txp:if_individual_article>

Without a plugin:

<txp:if_individual_article>
	<h2>Choose an Image</h2>
	<div class="thumb_container">
		<ul>
			<txp:php>
				echo article_custom (
					array(
						'category' => $GLOBALS['thisarticle']['category1'];,
						'form' => 'article_thumbs',
						'limit' => '6',
					)
				);
			</txp:php>
		</ul>
	</div>
<txp:else />
	<h2>Recent Photographs</h2>
	<div class="thumb_container">
		<ul>
			<txp:article_custom section="photography" limit="6" form="article_thumbs" />
		</ul>
	</div>
</txp:if_individual_article>

Last edited by jm (2007-01-11 03:21:34)

Offline

#5 2007-01-11 05:06:19

mattmikulla
Member
From: Nashville Tennessee
Registered: 2004-08-25
Posts: 281
Website

Re: How do I mimic rss_suparchive_bycat using textpattern conditionals?

Thanks JM, but I was hoping to do it without a plugin. I have it working with rss_suparchive_bycat, but I am trying to eliminate as many plugins as possible and use textpattern native.

I’ll try the php.

I would think that textpattern could handle it somehow with conditionals.


Art Rogue – Fine Art Photography

Offline

Board footer

Powered by FluxBB