Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#1 2008-03-05 17:10:13
- venkatesaya
- Member
- Registered: 2008-03-03
- Posts: 20
display posts per category
(1)
I have an article : ‘article 1 voor sectie articles’
it has categories ‘love’ and ‘peace’
when you hit the link to the categorie – only the title is displayed
this is also with the [<txp:category_list categories=“love, peace” label=“categories” break=“br”/>]
which I have added in the menu on the left
please go see http://texttest.venkatesaya.com/
I would like to have it like in
http://thebombsite.com/jat/boyish/
when you hit one of the categories in the menu on the right – not only the title, but also the whole post is displayed
I am new to this – and I have the feeling that my penny is starting to drop
I mean, if I understand how this is done, I will also be able to build other constructions
do I have to change a form? which one?
do I have to change (on the default template) in the following lines
<txp:if_category>
<txp:category title=“1” /> ***
<div class=“hfeed”>
<txp:article form=“article_listing” limit=“5” />
or on some other line?
when I add [x] under line *** , it is displayed (you’ll see it)
when I add <txp:article /> on the same line, nothing is displayed
(2)
how is the [keep reading] link done on the txp ‘boyish’ http://thebombsite.com/jat/boyish/
Last edited by venkatesaya (2008-03-05 18:18:46)
Om Namah Shivaya
Offline
Re: display posts per category
A category list is just another article list. So the output is controlled by the article form in use by whatever tag is displaying article lists on that page, typically <txp:article />. That article form is where you can tailor the output.
In your case it is the form called article_listing. Add <txp:body /> to that form (or, if you are using article_listing for something else, create a new form and change your page).
Code is topiary
Offline
#3 2008-03-05 20:05:37
- venkatesaya
- Member
- Registered: 2008-03-03
- Posts: 20
Re: display posts per category
I added <txp:body /> on different locations – it does NOT work
btw I did this before I posted this
“create a new form and change your page” – that is probably the solution
but I am too new at this txp – and yet I feel I am close to understanding it
PLEASE HELP ME SO THAT I CAN UNDERSTAND HOW TXP WORKS
hopefully I will find the answers in your book, when it is delivered from amazon
this is my form ARTICLE LISTING
<txp:if_first_article><ul class=“directory”></txp:if_first_article>
<li><span class=“entry-title”><txp:permlink>
<txp:title />
</txp:permlink></span> · <span class=“published”><txp:posted format=”%Y-%m-%d” /></span></li>
<txp:if_last_article></ul>
</txp:if_last_article>
this is my DEFAULT form
<txp:if_individual_article>
<h1 class=“entry-title”><txp:permlink><txp:title /></txp:permlink></h1>
<txp:else />
<h3 class=“entry-title”><txp:permlink><txp:title /></txp:permlink></h3>
</txp:if_individual_article>
<p class=“published”> <txp:posted /></p>
<div class=“entry-content”>
<txp:body />
</div>
<address class=“vcard author”> <span class=“fn”><txp:author /></span></address>
<p class=“tags”><txp:category1 title=“1” link=“1” />, <txp:category2 title=“1” link=“1” /></p>
<txp:comments_invite wraptag=“p” />
Last edited by venkatesaya (2008-03-05 20:43:21)
Om Namah Shivaya
Offline
Re: display posts per category
venkatesaya wrote:
I added <txp:body /> on different locations
it does NOT work
btw I did this before I posted this
OK, first thing I would do is confirm that you are working with the correct form. Put a test message inside the article_listing form, then see if the test message appears when you click a category.
Code is topiary
Offline
#5 2008-03-05 20:46:26
- venkatesaya
- Member
- Registered: 2008-03-03
- Posts: 20
Re: display posts per category
I put <txp:body /> in the article form
and it is displayed when I do the preview
but not on the site http://texttest.venkatesaya.com
Last edited by venkatesaya (2008-03-05 21:09:05)
Om Namah Shivaya
Offline
#6 2008-03-05 20:47:43
- els
- Moderator

- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: display posts per category
venkatesaya wrote:
how is the [keep reading] link done on the txp ‘boyish’ http://thebombsite.com/jat/boyish/
Offline
#7 2008-03-05 20:49:04
- els
- Moderator

- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: display posts per category
venkatesaya wrote:
I put an x and it is not there
so, it is the wrong form ?
Or the wrong page. Check (in Presentation > Sections) if section ‘default’ is set to use page ‘default’.
Offline
#8 2008-03-05 20:57:20
- venkatesaya
- Member
- Registered: 2008-03-03
- Posts: 20
Re: display posts per category
all Sections, including section ‘default’ are set to use page ‘default’
ik ben nieuw hier, Els – dank voor uw reply
ik voel dat ik zo dicht ben en iets ga leren
ik zou dit txp zo graag gebruiken en beheersen
I put <txp:body /> in the article form
and it is displayed when I do the preview
but not on the site http://texttest.venkatesaya.com
in the default template
I had
<txp:if_category>
<h2><txp:category title=“1” /></h2>
<txp:article form=“article_listing” limit=“5” />
and if I put <txp:body /> here also – nothing changes
please help me
Last edited by venkatesaya (2008-03-05 21:26:52)
Om Namah Shivaya
Offline
Re: display posts per category
venkatesaya wrote:
I put <txp:body /> in the article form
and it is displayed when I do the preview
but not on the site http://texttest.venkatesaya.com
What do you mean by the preview?
Code is topiary
Offline
#10 2008-03-05 21:59:07
- venkatesaya
- Member
- Registered: 2008-03-03
- Posts: 20
Re: display posts per category
when you have changed something on a form – you have a button preview and save
are you going to help me jsoo ?
Om Namah Shivaya
Offline
#11 2008-03-05 22:03:01
- els
- Moderator

- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: display posts per category
venkatesaya
Can you set Production status (in Preferences) to ‘debugging’? It will then output a tag trace at the bottom of the source code. You can either post that here, or I can have a look online.
Offline
#12 2008-03-05 22:16:21
- venkatesaya
- Member
- Registered: 2008-03-03
- Posts: 20
Re: display posts per category
Tag error: <txp:body/> -> Textpattern Notice: Article tags cannot be used outside an article context on line 1964
textpattern/lib/txplib_misc.php:1964 trigger_error()
textpattern/publish/taghandlers.php:1843 assert_article()
textpattern/publish.php:970 body()
processTags()
textpattern/publish.php:929 preg_replace_callback()
textpattern/publish/taghandlers.php:2721 parse()
textpattern/publish.php:970 if_category()
processTags()
textpattern/publish.php:929 preg_replace_callback()
textpattern/publish.php:466 parse()
online = http://texttest.venkatesaya.com/
ps
dit is een beetje moeilijk aan het worden voor een moedige senior
dank je Els
maar als jij niet opgeeft – doe ik mee
als ik dit display per category kan begrijpen kan ik het ook gebruiken voor andere andere displays
Last edited by venkatesaya (2008-03-05 22:42:29)
Om Namah Shivaya
Offline
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>« <txp:prev_title /></txp:link_to_prev>
<txp:link_to_next><txp:next_title /> »</txp:link_to_next>
</p>
<txp:else />
<p>
<txp:older>« <txp:text item=“older” /></txp:older>
<txp:newer><txp:text item=“newer” /> »</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 © 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