Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2010-05-07 21:05:22

claywso
Member
From: Durham, NC USA
Registered: 2004-12-20
Posts: 57
Website

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:

  1. domain.com/section displays a sticky article in that section
  2. domain.com/section/?c=category displays an article list
  3. 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

#2 2010-05-07 22:12:50

jsoo
Plugin Author
From: NC, USA
Registered: 2004-11-15
Posts: 1,793
Website

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

#3 2010-05-08 01:17:23

claywso
Member
From: Durham, NC USA
Registered: 2004-12-20
Posts: 57
Website

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

Board footer

Powered by FluxBB