Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#16 2013-04-25 10:01:34

Karsten
Member
From: Leiden, Netherlands
Registered: 2011-04-24
Posts: 47
Website

Re: Category list broken after update

Haha, the animals were an example, we don’t actually make books about dogs or cats :)

try:
http://www.sidestone.com/library/

the code I used was:

<txp:if_category>
<txp:article_custom section="library" category='<txp:category_list parent=''<txp:category />'' break=","><txp:category /></txp:category_list>' listform="Sidestone_list_library" pgonly="0" searchall="0" sort="Posted desc" time="any" status="4" limit="4" />
<txp:variable name="numPages"><txp:etc_numpages pageby="2" /></txp:variable>
<txp:etc_pagination range="1" pages='<txp:variable name="numPages" />' pgcounter="page"
  link="Page {*}" first="First" prev="Previous" next="Next" last="Last" />
<txp:else />

of course followed by the article code for the normal txp:article and ending with </txp:if_category>

Last edited by Karsten (2013-04-25 10:05:57)

Offline

#17 2013-04-25 10:06:49

Dragondz
Moderator
From: Algérie
Registered: 2005-06-12
Posts: 1,559
Website GitHub Twitter

Re: Category list broken after update

Hi

but where is a link that not works like expected? wich category has subcategories?

Offline

#18 2013-04-25 10:14:59

Karsten
Member
From: Leiden, Netherlands
Registered: 2011-04-24
Posts: 47
Website

Re: Category list broken after update

Most categories have subcategories, these books currently just don’t show up. As it is a live website, I don’t implement code that doesn’t work… so I don’t have a live-example… visitors should be able to use the site.

Offline

#19 2013-04-25 10:57:33

Karsten
Member
From: Leiden, Netherlands
Registered: 2011-04-24
Posts: 47
Website

Re: Category list broken after update

I’m afraid that for the time being, I’m giving up my attempts, I’m getting rid of all subcategories and will switch them to the main categories instead. Thanks to all for you help.

Offline

#20 2013-04-25 11:00:18

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

Re: Category list broken after update

The code you posted has some errors in it:

  • article_custom has no attributes such as listform, pgonly and searchall, and status is set to the default, making it redundant.
  • pageby is set to 2 while limit is set to 4. Both need to have the same values.
  • time is set to any while pagination is counted based on the default, past, and the etc_numpages doesn’t have the section neither categories set.

Basically, both tags, article_custom and etc_numpages need the exact same attributes, otherwise the number of pages won’t be calculated correctly.

Last edited by Gocom (2013-04-25 11:01:29)

Offline

Board footer

Powered by FluxBB