Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#13 2007-08-08 10:32:56

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: articles from a category

<txp:article_custom /> is not the same as <txp:article />, so try something like this instead:

<txp:if_article_list>
  <txp:php>
     echo article_custom(array('section'=>'archive',
     'form'=>'article_list','category'=>$GLOBALS['pretext']['c'],
     ));
  </txp:php>
<txp:else />
  <txp:article limit="5" />
</txp:if_article_list>

Offline

#14 2007-08-08 11:14:14

swati.miniyar
Member
Registered: 2007-08-06
Posts: 39

Re: articles from a category

Thank u soooooo much!!!
Its giving me results..But not exactly what i want!!!Its giving me result on article-archive…i want to show it
on archive..
The listing of article title i am getting on article archive.If i click on title its giving the detailed article on that page only..
I want to show the article in detai on other page-archive.. this section (Archive) uses page as article-archive..

My simple question is—
Can i go from one page-template to other page-template?

Last edited by swati.miniyar (2007-08-08 11:29:34)

Offline

#15 2007-08-08 13:12:25

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: articles from a category

Its giving me result on article-archive…i want to show it on archive..

Correct me if I’m wrong, but is this what you want:

  • http://www.csaserv.com/rocketsociety/Archive/ -> show list of articles using ‘article-archive’ template
  • http://www.csaserv.com/rocketsociety/Archive/id/title -> show individual article using ‘article’ template

That’s not possible… but what you can do is:

<!-- common parts at the top of both archive and article-archive here -->
<txp:if_article_list>
  <!-- specific article-archive template code here (for article list) -->
  <txp:php>
     echo article_custom(array('section'=>'archive',
     'form'=>'article_list','category'=>$GLOBALS['pretext']['c'],
     ));
  </txp:php>
<txp:else />
  <!-- specific article template code here (for individual article) -->
  <txp:article limit="5" />
</txp:if_article_list>
<!-- common parts at the bottom of both archive and article-archive here -->

And you probably can replace the whole PHP part with <txp:article listform=“article_list” />

Offline

#16 2007-08-08 13:44:37

swati.miniyar
Member
Registered: 2007-08-06
Posts: 39

Re: articles from a category

yes..u r correct!!! ok no problem…i’v implemented above code..
Thanks a lot for your help!!

Offline

Board footer

Powered by FluxBB