Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
displaying a static article
looking for a little help here… here’s what I’m trying to do:
when a particular section is clicked, i’d like one full ‘sticky’ article to display.
i also have a number of categories that display article_lists as defined below.
so, here’s what i’m shooting for:
- domain.com/section displays a sticky article in that section
- domain.com/section/?c=category displays an article list
- domain.com/section/article_title displays the full article
i guess i just don’t know how to do #1 above? any help is greatly appreciated. here’s the code i’m using now (www.strongdurhamschools.com)
<txp:if_category>
<txp:cbs_category_list parent='<txp:category />' section="testimonials" showcount="true" wraptag="ul" break="li" label='Testimonials for <txp:category title="1" />' labeltag="h2" />
</txp:if_category>
<txp:if_section name="news">
<txp:linklist form="Links" category="news" sort="linksort" wraptag="ul" break="li" label="Articles about Strong Durham Schools" labeltag="h3" />
<txp:else />
<txp:if_individual_article>
<txp:article />
</txp:if_individual_article>
<txp:if_article_list>
<txp:article limit="5" form="excerpt" />
<h3><txp:older><< Older Stories</txp:older> <txp:newer> More Recent Stories >></txp:newer></h3>
</txp:if_article_list>
</txp:if_section>
Offline
Re: displaying a static article
Greetings from … Durham!
Basic control structure could look like this:
<txp:if_category>
<!-- category list tags here -->
<txp:else />
<txp:if_individual_article>
<txp:article />
<txp:else />
<txp:article status="sticky" limit="1" />
</txp:if_individual_article>
</txp:if_category>
The nesting is the key. With your code, for example, the if_article_list
block will be triggered in both your case 1 and case 2.
Code is topiary
Offline
Re: displaying a static article
thanks! glad to find a local txp person!
your guidance worked, and now the site is working properly.
we’ll be launching a new graphic design in the next few weeks, so this is still in it’s rough stages, but thanks for your help!
Offline
Pages: 1