Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
Articles Page
Hi, please take a look at my site at http://simplecandy.com/4.0/
Okies, my plan is that if you click the articles link in the sub-nav you will see a list of all the articles (basically an archive page) BUT if you click on an article for that section (all the articles on the main page) then it will show the article instead of the archive!
I’ve played around with the syntax for my articles page, but it either ALWAYS shows the latest article or ONLY shows the list even when choosing an article to preview.
Please can you take a look at my code and adjust it so that I can get the desired structure. Thank you. x
<txp:if_category>
<h2><txp:category title="1" /></h2>
<div class="hfeed">
<txp:article form="article_listing" limit="5" />
</div>
<txp:else />
<txp:if_search>
<h2><txp:text item="search_results" />: <txp:page_url type="q" /></h2>
<div class="divider"><img src="<txp:site_url />images/1.gif" width="400" height="1" alt="---" title="" /></div>
</txp:if_search>
<div class="hfeed">
<txp:article form="single" limit="1" />
</div>
</txp:if_category>
<txp:if_individual_article>
<p style="margin:0;"><txp:link_to_prev>« <txp:prev_title /></txp:link_to_prev>
<txp:link_to_next><txp:next_title /> »</txp:link_to_next></p>
<txp:else />
<p style="margin:0;"><txp:older>« <txp:text item="older" /></txp:older>
<txp:newer><txp:text item="newer" /> »</txp:newer></p>
</txp:if_individual_article>
~ Cameron
Offline
#2 2008-10-17 15:44:23
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: Articles Page
I had a hard time finding the ‘articles’ link ;)
Instead of <txp:article form="single" limit="1" />
try <txp:article form="single" listform="article_listing" limit="5" />
.
Offline
Re: Articles Page
Are you going to be using categories Cameron cuz you have them in your code above but you don’t seem to be showing them within your articles? Anyway, assuming that you are you haven’t told TXP what to do for an article_list so maybe something like this might work:-
<txp:if_category>
<h2><txp:category title="1" /></h2>
<div class="hfeed">
<txp:article form="article_listing" limit="5" />
</div>
<txp:else />
<txp:if_search>
<h2><txp:text item="search_results" />: <txp:page_url type="q" /></h2>
<div class="divider"><img src="<txp:site_url />images/1.gif" width="400" height="1" alt="---" title="" /></div>
</txp:if_search>
<div class="hfeed">
<txp:if_individual_article>
<txp:article form="single" limit="1" />
<p style="margin:0;"><txp:link_to_prev>« <txp:prev_title /></txp:link_to_prev> <txp:link_to_next><txp:next_title /> »</txp:link_to_next></p>
<txp:else />
<txp:article form="article_listing" limit="5" />
<p style="margin:0;"><txp:older>« <txp:text item="older" /></txp:older> <txp:newer><txp:text item="newer" /> »</txp:newer></p>
</txp:if_individual_article>
</div>
</txp:if_category>
Stuart
In a Time of Universal Deceit
Telling the Truth is Revolutionary.
Offline
Re: Articles Page
Cool that seems to have got it working nicely :) Cheers. x
~ Cameron
Offline
Pages: 1