Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#13 2008-03-05 22:30:46

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

Re: display posts per category

OK, I must admit I had never used that Preview function before. And it produces pretty strange results for me!

Anyway, what I am trying to discover is whether or not the output of that form is really what you are seeing on the actual site. It sounds like you aren’t. Please post your current default page; it looks as though you have made some changes since first posting.


Code is topiary

Offline

#14 2008-03-05 22:37:03

venkatesaya
Member
Registered: 2008-03-03
Posts: 20

Re: display posts per category

<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>
<html xmlns=“http://www.w3.org/1999/xhtml” xml:lang=“en” lang=“en”>
<head> <meta http-equiv=“Content-Type” content=“text/html; charset=utf-8” /> <title><txp:page_title /></title> <link rel=“home” href=”<txp:site_url />” /> <txp:feed_link flavor=“atom” format=“link” label=“Atom” /> <txp:feed_link flavor=“rss” format=“link” label=“RSS” /> <txp:css format=“link” />
</head>
<body id=”<txp:if_section name=“default”>front<txp:else /><txp:section /></txp:if_section>”>
<!— accessibility —>
<div id=“accessibility”> <ul> <li><a href=”#content”><txp:text item=“go_content” /></a></li> <li><a href=”#sidebar-1”><txp:text item=“go_nav” /></a></li> <li><a href=”#sidebar-2”><txp:text item=“go_search” /></a></li> </ul>

</div> <!— head —> <div id=“head”> <div id=“site-name”><txp:link_to_home><txp:site_name /></txp:link_to_home></div> <div id=“site-slogan”><txp:site_slogan /></div> </div>
<table width=“100%” border=“0” cellspacing=“0” cellpadding=“0”>
<tr> <td valign=“top” class=“sidebar_links”> <!— SIDEBAR left —> <hr noshade size=“1”> <txp:section_list sections=“about, articles” label=“sections” break=“br” />
<hr noshade size=“1”>
<txp:category_list categories=“love, peace” label=“categories” break=“br”/>
<hr noshade size=“1”>
<txp:search_input wraptag=“p” /> <p> <txp:feed_link label=“RSS” /> / <txp:feed_link flavor=“atom” label=“Atom” /> </p> <hr noshade size=“1”> tekst </td> <td valign=“top” class=“corpus”> <!— center —> <txp:if_category><!— begin category —> <h2><txp:category title=“1” /></h2>
<div class=“hfeed”>
<txp:article form=“article_listing” limit=“5” /> <txp:body />
</div> <txp:else /> <txp:if_search> <h2><txp:text item=“search_results” />: <txp:page_url type=“q” /></h2> <hr noshade size=“1”> </txp:if_search> <div class=“hfeed”> <txp:article limit=“5” /> </div> </txp:if_category><!— einde category —> <txp:if_individual_article><!— begin article —> <hr noshade size=“1”> <p> <txp:link_to_prev>&#171; <txp:prev_title /></txp:link_to_prev> <txp:link_to_next><txp:next_title /> &#187;</txp:link_to_next> </p> <txp:else /> <p> <txp:older>&#171; <txp:text item=“older” /></txp:older> <txp:newer><txp:text item=“newer” /> &#187;</txp:newer> </p> </txp:if_individual_article><!— einde article —> </td> <td valign=“top” class=“sidebar_rechts”> <!— Sidebar right —> <hr noshade size=“1”> links <txp:linklist wraptag=“p” /> <!— beeldje —> <hr noshade size=“1”> tekst </td>
</tr>
</table>
<!— footer —> <div id=“foot”> design &copy; venkatesa – cms powered by textpattern </div>
</body>
</html>


Om Namah Shivaya

Offline

#15 2008-03-05 22:40:02

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

Re: display posts per category

Leeftijd heeft er niks mee te maken :)

The tag trace is at the bottom of the html source code (when you hit ‘view source’), the code you posted is a textpattern notice. Which is telling us that you added a <txp:body /> tag directly on the page. Better remove that.

But the reason why no articles are being displayed is that your section ‘article’ is set to not to be displayed on the front page (in Presentation > Sections). Category pages use the front page settings, so the article tag cannot find any articles that are ‘allowed’ to be displayed.
Not a problem. If you only want to display your ‘about’ article on the front page, change the <txp:article limit="5" /> that is in the if_category tags after <txp:else /> to

<txp:article_custom section="about" limit="1" />

or

<txp:article_custom id="123" />

“123” being the id of your about article.

Then set section ‘article’ to be displayed on the front page.

Offline

#16 2008-03-05 22:40:39

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

Re: display posts per category

OK, you have <txp:body /> in the page, but it needs to be in the article form. Remove it from the default page, then add it to the form called article_listing. That is, go to Presentation->Forms, click on article_listing, and add the tag there.


Code is topiary

Offline

#17 2008-03-05 23:13:33

venkatesaya
Member
Registered: 2008-03-03
Posts: 20

Re: display posts per category

tanx J Soo
dank je Els
ik denk dat het opgelost is
ik had alleen de about sectie op de frontpagina gezet, omdat ik die wilde gebruiken als welkom pagina
ik had de andere secties ‘niet op de frontpagina’ gezet
hierdoor had ik deze uitgeschakeld voor dit soort display

nu denk ik dat ik een echt probleem heb :)
dit ding heeft me echt in de ban
ik heb het boek gekocht op eBay in de hoop daar alle antwoorden te vinden
maar nu voel ik dat het heel wat programmeerkennis zal vergen
zijn er nog andere bronnen met duidelijke en eenvoudige uitleg?
of zal ik jullie nog mogen/moeten lastig vallen – alhoewel ik dit spannend vind

mag ik je een dikke zoen sturen?
voila !
tis voorbij middernacht hier in belgie
nu moet ik een beetje slapen of anders ben ik morgen geen mens

Last edited by venkatesaya (2008-03-05 23:14:22)


Om Namah Shivaya

Offline

#18 2008-03-05 23:20:22

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

Re: display posts per category

venkatesaya wrote:

nu denk ik dat ik een echt probleem heb :)
dit ding heeft me echt in de ban

Dat is wat we willen :)

zijn er nog andere bronnen met duidelijke en eenvoudige uitleg?

Ja, wij hier :) Vraag maar raak!
Er is trouwens ook een nederlandstalig forum hier als je dat makkelijker vindt.

Sleep well and good luck with your site.

Edit: there is also TextBook and the FAQ (which unfortunately is down at the moment).

Last edited by els (2008-03-05 23:23:00)

Offline

#19 2008-03-05 23:28:20

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

Re: display posts per category

P.S. Your question in the report: it was the latter (trying to answer your question) :)

Offline

#20 2008-03-06 00:01:52

venkatesaya
Member
Registered: 2008-03-03
Posts: 20

Re: display posts per category

ik heb nu dit
en heb alle combinaties geprobeerd
ben eigenlijk een beetje hopeloos nu
ik wil eerst en alleen de about pagina krijgen wanneer je op de site komt
maar nu krijg je ook de about pagina als je op de articles klikt
en nochtans heeft de sectie articles > 2 articles

<txp:section_list sections=“about, articles, “ label=“sections” break=“br” />
<txp:category_list categories=“love, peace” label=“categories” break=“br”/>
<txp:if_category><!— begin category —>
<h2><txp:category title=“1” /></h2>
<txp:article form=“article_listing” limit=“5” />
<txp:else />
<txp:article_custom section=“about” limit=“1” />
<!— <txp:article_custom id=“2” />—>
<!—<txp:article limit=“1” /> —>


Om Namah Shivaya

Offline

#21 2008-03-06 00:09:47

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

Re: display posts per category

<txp:section_list sections="about, articles, " label="sections" break="br" />		
<txp:category_list categories="love, peace" label="categories" break="br"/>

<txp:if_section name="">
   <txp:if_category><!-- begin category -->
      <h2><txp:category title="1" /></h2>
      <txp:article form="article_listing" limit="5" />
   <txp:else /><!-- front page -->
      <txp:article_custom section="about" limit="1" /> 
   </txp:if_category>
<txp:else />
   <txp:article /> <!-- article tag for other sections, use the appropriate attributes (form, limit etc.) -->
</txp:if_section>

Offline

Board footer

Powered by FluxBB