Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2012-06-16 02:59:00

wispa
Member
Registered: 2012-05-10
Posts: 10

How to display archived links

So I’m trying to create an archive like this;
http://pediatric.apatalk.com/special-topics/

However, the actual links won’t go to their respective page and I’d like to know what I’m doing wrong?

The page template looks like this;

<div id="content">
<ul><txp:article_custom limit=99999 form="archive-list" section="special-topics" /></ul>
</div><!-- end content-->

The form looks like this;

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

Offline

#2 2012-06-16 04:09:49

maruchan
Member
From: Ukiah, California
Registered: 2010-06-12
Posts: 590
Website

Re: How to display archived links

You gotta quote your 99999…try "99999"

Last edited by maruchan (2012-06-16 04:10:11)

Offline

#3 2012-06-16 04:14:31

maruchan
Member
From: Ukiah, California
Registered: 2010-06-12
Posts: 590
Website

Re: How to display archived links

Oh and also—for your page template, try this:

<div id="content">
<txp:if_individual_article>
<txp:article />
<txp:else />
<ul><txp:article_custom limit="99999" form="archive-list" section="special-topics" /></ul>
</txp:if_individual_article>
</div><!-- end content-->

You need to show the article_custom unordered list if it’s an article list. But TXP is also trying to show individual articles using this page template. So you need something to do if you have an individual article on display, as opposed to a list of article links.

Last edited by maruchan (2012-06-16 04:15:00)

Offline

#4 2012-06-18 22:23:28

wispa
Member
Registered: 2012-05-10
Posts: 10

Re: How to display archived links

One additional question as I’m still trying to wrap my head around conditional statements.

I want to show all the articles for a particular section. How would I do this ?

I have a form called “sidebar” which calls from another form, “current-section” which has this;

<txp:if_section>
<ul><txp:article_custom limit=“99999” form=“archive-list” /></ul>

<txp:else />
</txp:if_section>

And the archive-list form is this;

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

However, all articles from all sections are appearing instead of just articles from the current section.

Last edited by wispa (2012-06-18 22:25:46)

Offline

#5 2012-06-18 23:57:24

maruchan
Member
From: Ukiah, California
Registered: 2010-06-12
Posts: 590
Website

Re: How to display archived links

article_custom will show all articles from all sections unless you tell it not to.

For example: <txp:article_custom section=“articles, photos” /> would limit it to only articles from the “articles” and “photos” sections.

You can also use a single quote and drop the <txp:section /> tag in there, to tell it “show articles from whichever section we’re in”:

<txp:article_custom limit=“99999” form=“archive-list” section=’<txp:section />’ />

But I think most users will use <txp:article /> for this rather than article_custom, since it will show articles from only the current section by default. It will also do pagination (think: “previous” and “next” links at the bottom of the page), while it’s tricky to do that with article_custom.

Last edited by maruchan (2012-06-18 23:58:17)

Offline

#6 2012-06-19 22:31:54

wispa
Member
Registered: 2012-05-10
Posts: 10

Re: How to display archived links

Actually, I believe that will only show an articlle that I’m currently viewing. It will not show all articles within that section.

<txp:if_section>
<ul><txp:article limit=“99999” form=“archive-list” /></ul>

<txp:else />
</txp:if_section>

Offline

Board footer

Powered by FluxBB