Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2006-03-09 17:20:20

tez
Member
Registered: 2006-02-25
Posts: 22

Sort article display alphabetically?

Hi

I’m still struggling with getting my articles to display alphabetically.

I believe that this is the right tag:

<code><txp:article sortby=“Title” sortdir=“asc”/></code>

and I need to put it in my page template.

I’m pretty sure that I need to remove another article tag to stop both an alphabetical and non-alphabetical display.

So:

Where does the tag go?

And what do I remove?

Hope somebody can help.

Many thanks ):

Tez

<code><div id=“content”>

<txp:if_section name=”,article”>

<txp:if_article_list>

<txp:article limit=“7” />

<div class=“navigation”>
<div class=“alignleft”><txp:older>Previous Entries</txp:older></div>
<div class=“alignright”><txp:newer>Next Entries</txp:newer></div>
</div>

<txp:else />

<txp:article />

</txp:if_article_list>

</txp:if_section>

<txp:if_section name=“about”>

<txp:article />

</txp:if_section>

<txp:if_section name=“contact”>

<txp:article />

</txp:if_section>

</div>
</code>

Offline

#2 2006-03-09 20:57:29

thebombsite
Archived Plugin Author
From: Exmouth, England
Registered: 2004-08-24
Posts: 3,251
Website

Re: Sort article display alphabetically?

You need to replace the <code><txp:article limit=“7” /></code> near the top but remember to add the “limit” to your new tag as well.


Stuart

In a Time of Universal Deceit
Telling the Truth is Revolutionary.

Offline

#3 2006-03-09 20:59:48

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: Sort article display alphabetically?

Hi Tez,

Just add sortby="Title" sortdir="asc" to the article tags where you want to sort alphabetically. There are 4 article tags on your page:

<code><div id=“content”>
<txp:if_section name=”,article”>
<txp:if_article_list>
<txp:article limit=“7” /></code> this article tag tells which 7 articles will be displayed if you are in the default section (homepage, category list) or in section ‘article’
<code><div class=“navigation”>
<div class=“alignleft”><txp:older>Previous Entries</txp:older></div>
<div class=“alignright”><txp:newer>Next Entries</txp:newer></div>
</div>
<txp:else />
<txp:article /></code> this article tag displays an individual article
<code></txp:if_article_list>
</txp:if_section>
<txp:if_section name=“about”>
<txp:article /></code> this article tag says which articles are displayed if you are in section ‘about’
<code></txp:if_section>
<txp:if_section name=“contact”>
<txp:article /></code> this article tag says which articles are displayed if you are in section ‘contact’
<code></txp:if_section>
</div>
</code>
You can add the attributes to the first, third and/or fourth article tag.<br />
EDIT: Stuart, not again…;)

Last edited by els (2006-03-09 21:00:25)

Offline

#4 2006-03-09 21:32:37

thebombsite
Archived Plugin Author
From: Exmouth, England
Registered: 2004-08-24
Posts: 3,251
Website

Re: Sort article display alphabetically?

Yep. It’s me again. Which one are you going to look at next. I’ll avoid it. ;)


Stuart

In a Time of Universal Deceit
Telling the Truth is Revolutionary.

Offline

#5 2006-03-10 09:23:49

tez
Member
Registered: 2006-02-25
Posts: 22

Re: Sort article display alphabetically?

Hi Els & Stuart

Many thanks!

Tez

Offline

Board footer

Powered by FluxBB