Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2010-06-04 08:10:46

jpdupont
Member
Registered: 2004-10-01
Posts: 752

categories not listed in a section

Hello,
I don’t understand why categories are not listed in a particular section on my site :

I simply copy/paste the code from the textbook.
In the debug info, the category list loop seems to be ok …

pierrard.be/formations

On this page, below the title “Etudier à Pierrard”, I want to list all my categories

I put this code on a module :

<div id="lemenu">
<txp:category_list wraptag="ul" break="" this_section="1">
<li><txp:category title="1" link="1" /></li>
</txp:category_list>
</div>

Debug info :

	[Module: menuvert_formations_v3]
	<txp:category_list wraptag="ul" break="" this_section="1">
		[SQL (0,00018906593322754): select name, title from txp_category where type = 'article' and name not in('default','root')   order by name ASC]
		<txp:category title="1" link="1" />
		<txp:category title="1" link="1" />
		<txp:category title="1" link="1" />
		<txp:category title="1" link="1" />
		<txp:category title="1" link="1" />
		<txp:category title="1" link="1" />
		<txp:category title="1" link="1" />
		<txp:category title="1" link="1" />
		<txp:category title="1" link="1" />
		<txp:category title="1" link="1" />
		<txp:category title="1" link="1" />
		<txp:category title="1" link="1" />
	</txp:category_list>

Same code is ok on a test section :

test section and category list

Offline

#2 2010-06-04 08:27:43

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

Re: categories not listed in a section

When I view the html code using Firebug I see this:

<div id="lemenu">
<ul class="category_list" style="display: none;">

Last edited by els (2010-06-04 08:28:17)

Offline

#3 2010-06-04 08:44:35

jpdupont
Member
Registered: 2004-10-01
Posts: 752

Re: categories not listed in a section

Thanks Els – I forget to remove a JQuery line.

But the real problem is in this code (with no output … ), from your tutorial on txptips (I use this without problem on an other site) :

<div id="lemenu">
<txp:category_list break="" >
   <txp:variable name="has_articles" value='<txp:article_custom section=''<txp:section />'' category=''<txp:category />'' limit="1" />' />
   <txp:if_variable name="has_articles" value="">
   <txp:else />
    <h4><txp:category title="1" /></h4>
   <txp:article_custom section='<txp:section />' category='<txp:category />' wraptag="ul" break="li" class='<txp:if_variable name="cat" value=''<txp:category />''>expand<txp:else/></txp:if_variable>'>
   <txp:permlink class='<txp:if_variable name="artid" value=''<txp:article_id />''>active<txp:else/></txp:if_variable>'><txp:title /></txp:permlink>
   </txp:article_custom>
   </txp:if_variable>
</txp:category_list>
</div>

If I remove the if_variable code, all is ok. With the code above, nothing is displayed.
I don’t see the error in the if_variable code …

Offline

#4 2010-06-04 14:31:14

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

Re: categories not listed in a section

Ah, could it be that you don’t have an article form ‘default’? If it doesn’t exist, the value will always be empty, even if an article is found. Change the variable tag into this:

<txp:variable name=“has_articles” value=’<txp:article_custom section=’‘<txp:section />’‘ category=’‘<txp:category />’‘ limit=“1” />’><txp:title /></txp:article_custom>’ />

Edit again: too many closing tags and quotes… apologies! Final try:

<txp:variable name="has_articles" value='<txp:article_custom section=''<txp:section />'' category=''<txp:category />'' limit="1"><txp:title /></txp:article_custom>' />

Last edited by els (2010-06-05 14:03:46)

Offline

#5 2010-06-04 14:44:38

jpdupont
Member
Registered: 2004-10-01
Posts: 752

Re: categories not listed in a section

I have an empty ‘default’ article form.

When I use your code, I get an error on <txp:title /> : must be in article context.

Offline

#6 2010-06-04 15:33:37

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

Re: categories not listed in a section

That was very stupid of me, I forgot to close the tag. I edited my previous post, please try again.

Last edited by els (2010-06-04 15:35:14)

Offline

#7 2010-06-05 03:57:45

jpdupont
Member
Registered: 2004-10-01
Posts: 752

Re: categories not listed in a section

Els, yesterday, I see the no closed tag, and I closed it myself :)
The error occurs with closed tag :

<pre>Erreur de balise :  <b>&lt;txp:title /&gt;</b> -> <b> Textpattern Notice: Les balises spécifiques aux articles ne peuvent pas être utilisées en dehors du contexte <em>article</em>  on line 2186</b></pre>
<pre style="padding-left: 2em;" class="backtrace"><code>textpattern/lib/txplib_misc.php:2186 trigger_error()
textpattern/publish/taghandlers.php:2131 assert_article()
textpattern/publish.php:1146 title()
textpattern/publish.php:1068 processTags()
textpattern/publish/taghandlers.php:4132 parse()
textpattern/publish.php:1146 variable()
textpattern/publish.php:1081 processTags()
textpattern/publish/taghandlers.php:1087 parse()
textpattern/publish.php:1146 category_list()
...
...

Last edited by jpdupont (2010-06-05 04:07:33)

Offline

#8 2010-06-05 04:06:27

jpdupont
Member
Registered: 2004-10-01
Posts: 752

Re: categories not listed in a section

Now, it works if I put a <txp:title /> in the empty default form …
It seems that the default form must be filled with a txp tag … Bug ???

I don’t understand the “article context” notice above because I’m in an article context !

I use this code (it’s an exact copy/paste) on an other site without any problem. And there, the default form is empty !
The difference between the 2 sites :

  • site A (don’t works) : Textpattern: 4.2.0 (r3332)
  • site B (works) : Textpattern: 4.2.0 (r3329)

Last edited by jpdupont (2010-06-05 04:25:25)

Offline

#9 2010-06-05 05:29:08

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

Re: categories not listed in a section

Post your full tag trace from the problem page.

jpdupont wrote:

r3332 […] r3329

Using non stable releases on live sites is not really adviced.

Offline

#10 2010-06-05 06:06:20

jpdupont
Member
Registered: 2004-10-01
Posts: 752

Re: categories not listed in a section

<!-- Runtime:    0,0999 -->
<!-- Query time: 0,041393 -->
<!-- Queries: 41 -->
<!-- Memory: 5281Kb, <txp:title/> -->
<!-- txp tag trace: 
[SQL (0,00093984603881836): select name, data from txp_lang where lang='fr-fr' AND ( event='public' OR event='common')]
[SQL (0,024609804153442): select name, code, version from txp_plugin where status = 1 AND type IN (0,1) order by load_order]
[SQL (0,00081706047058105): select name,code,version from txp_plugin where status = 1 AND name='smd_lib']
[SQL (0,00055384635925293): select name, val from txp_prefs where prefs_id=1 AND user_name='']
[SQL (0,00026512145996094): 
    SELECT
      `name` AS custom_set,
      `val` AS name,
      `position`,
      `html` AS type
    FROM
      `txp_prefs`
    WHERE
      `event`='custom'
    ORDER BY
      `position`
  ]
[SQL (0,00012803077697754): 
      SELECT
        `name`, `val`
      FROM
        `txp_prefs`
      WHERE
        `html` = 'date-picker'
      AND
        `name` LIKE 'custom_%'
      ORDER BY
        `name`
    ]
[SQL (0,0008690357208252): show columns from smd_tags]
[SQL (0,00014781951904297): select name,val,html from txp_prefs where name IN ('smd_tag_u_sec','smd_tag_u_pnam','smd_tag_u_ptyp') ORDER BY name]
[SQL (0,00010800361633301): select name from txp_section where `name` like 'formations' limit 1]
[SQL (0,00011205673217773): select page, css from txp_section where name = 'formations' limit 1]
[SQL (0,00019097328186035): select user_html from txp_page where name='formations']
[Page: formations]
<txp:output_form form="header_int" />
	[SQL (0,00034499168395996): select Form from txp_form where name='header_int']
	[Module: header_int]
	<txp:output_form form="meta" />
		[SQL (0,00039196014404297): select Form from txp_form where name='meta']
		[Module: meta]
	<txp:rvm_css format="link" n="amp_int" />
	<txp:rvm_css format="link" n="amp_int_slidepanel" />
	<txp:output_form form="amp_scripts_2010" />
		[SQL (0,0002892017364502): select Form from txp_form where name='amp_scripts_2010']
		[Module: amp_scripts_2010]
	<txp:rvm_css format="link" n="amp_int_ie" />
	<txp:output_form form="js_cycle"/>
		[SQL (0,00035405158996582): select Form from txp_form where name='js_cycle']
		[Module: js_cycle]
	<txp:output_form form="js_diaporama_prev_next"/>
		[SQL (0,00025081634521484): select Form from txp_form where name='js_diaporama_prev_next']
		[Module: js_diaporama_prev_next]
	<txp:section/>
<txp:if_article_list>
	[<txp:if_article_list>: true]
	<txp:article status="sticky" limit="1" >
		[SQL (0,00067496299743652): select *, unix_timestamp(Posted) as uPosted, unix_timestamp(Expires) as uExpires, unix_timestamp(LastMod) as uLastMod from textpattern where 1=1 and Status = 5 and Posted <= now() and (now() <= Expires or Expires = '0000-00-00 00:00:00') and Section IN ('formations') order by Posted desc limit 0, 1]
		[article 14]
		<txp:variable name="artid" value='<txp:article_id />' />
			[attribute 'value']
			<txp:article_id />
			[/attribute]
	</txp:article>
</txp:if_article_list>
<txp:output_form form="topnavigation_banniere"/>
	[SQL (0,00022315979003906): select Form from txp_form where name='topnavigation_banniere']
	[Module: topnavigation_banniere]
<txp:if_article_list>
	[<txp:if_article_list>: true]
	<txp:article status="sticky" limit="1" >
		[SQL (0,00052499771118164): select *, unix_timestamp(Posted) as uPosted, unix_timestamp(Expires) as uExpires, unix_timestamp(LastMod) as uLastMod from textpattern where 1=1 and Status = 5 and Posted <= now() and (now() <= Expires or Expires = '0000-00-00 00:00:00') and Section IN ('formations') order by Posted desc limit 0, 1]
		[article 14]
		<txp:output_form form="galerie_intro"/>
			[SQL (0,00023794174194336): select Form from txp_form where name='galerie_intro']
			[Module: galerie_intro]
			<txp:smd_gallery category='<txp:section/>_galerie'>
				[attribute 'category']
				<txp:section/>
				[/attribute]
				[SQL (0,00020909309387207): 
			SELECT DISTINCT txp_image.name,txp_image.id,txp_image.alt,txp_image.caption,txp_image.category,txp_image.author,txp_image.date,txp_image.ext,txp_image.w,txp_image.h,txp_image.thumb_w,txp_image.thumb_h,txp_image.thumbnail
			FROM txp_image
			WHERE (1=1 AND  (txp_image.category IN ('formations_galerie')) ) ORDER BY txp_image.category asc
			LIMIT 0, 99999
		]
			</txp:smd_gallery>
		<txp:body/>
		<txp:excerpt/>
	</txp:article>
</txp:if_article_list>
<txp:output_form form="menuvert_formations_v3"/>
	[SQL (0,00022101402282715): select Form from txp_form where name='menuvert_formations_v3']
	[Module: menuvert_formations_v3]
	<txp:category_list break="" >
		[SQL (0,00017714500427246): select name, title from txp_category where type = 'article' and name not in('default','root')   order by name ASC]
		<txp:variable name="has_articles" value='<txp:article_custom section=''<txp:section />'' category=''<txp:category />'' limit="1" />'/>
			[attribute 'value']
			<txp:article_custom section='<txp:section />' category='<txp:category />' limit="1" />
				[attribute 'section']
				<txp:section />
				[/attribute]
				[attribute 'category']
				<txp:category />
				[/attribute]
				[SQL (0,00069594383239746): select *, unix_timestamp(Posted) as uPosted, unix_timestamp(Expires) as uExpires, unix_timestamp(LastMod) as uLastMod from textpattern where 1=1 and Status = 4 and Posted <= now() and (now() <= Expires or Expires = '0000-00-00 00:00:00') and (Category1 IN ('automobile') or Category2 IN ('automobile')) and Section IN ('formations') order by Posted desc limit 0, 1]
				[article 13]
				[SQL (0,00021505355834961): select Form from txp_form where name='default']
				[Module: default]
			[/attribute]
		<txp:if_variable name="has_articles" value="">
			[<txp:if_variable name="has_articles" value="">: true]
		</txp:if_variable>
		<txp:variable name="has_articles" value='<txp:article_custom section=''<txp:section />'' category=''<txp:category />'' limit="1" />'/>
			[attribute 'value']
			<txp:article_custom section='<txp:section />' category='<txp:category />' limit="1" />
				[attribute 'section']
				<txp:section />
				[/attribute]
				[attribute 'category']
				<txp:category />
				[/attribute]
				[SQL (0,00054192543029785): select *, unix_timestamp(Posted) as uPosted, unix_timestamp(Expires) as uExpires, unix_timestamp(LastMod) as uLastMod from textpattern where 1=1 and Status = 4 and Posted <= now() and (now() <= Expires or Expires = '0000-00-00 00:00:00') and (Category1 IN ('bois-construction') or Category2 IN ('bois-construction')) and Section IN ('formations') order by Posted desc limit 0, 1]
			[/attribute]
		<txp:if_variable name="has_articles" value="">
			[<txp:if_variable name="has_articles" value="">: true]
		</txp:if_variable>
		<txp:variable name="has_articles" value='<txp:article_custom section=''<txp:section />'' category=''<txp:category />'' limit="1" />'/>
			[attribute 'value']
			<txp:article_custom section='<txp:section />' category='<txp:category />' limit="1" />
				[attribute 'section']
				<txp:section />
				[/attribute]
				[attribute 'category']
				<txp:category />
				[/attribute]
				[SQL (0,00053596496582031): select *, unix_timestamp(Posted) as uPosted, unix_timestamp(Expires) as uExpires, unix_timestamp(LastMod) as uLastMod from textpattern where 1=1 and Status = 4 and Posted <= now() and (now() <= Expires or Expires = '0000-00-00 00:00:00') and (Category1 IN ('cefa-alternance') or Category2 IN ('cefa-alternance')) and Section IN ('formations') order by Posted desc limit 0, 1]
			[/attribute]
		<txp:if_variable name="has_articles" value="">
			[<txp:if_variable name="has_articles" value="">: true]
		</txp:if_variable>
		<txp:variable name="has_articles" value='<txp:article_custom section=''<txp:section />'' category=''<txp:category />'' limit="1" />'/>
			[attribute 'value']
			<txp:article_custom section='<txp:section />' category='<txp:category />' limit="1" />
				[attribute 'section']
				<txp:section />
				[/attribute]
				[attribute 'category']
				<txp:category />
				[/attribute]
				[SQL (0,00051689147949219): select *, unix_timestamp(Posted) as uPosted, unix_timestamp(Expires) as uExpires, unix_timestamp(LastMod) as uLastMod from textpattern where 1=1 and Status = 4 and Posted <= now() and (now() <= Expires or Expires = '0000-00-00 00:00:00') and (Category1 IN ('commerce') or Category2 IN ('commerce')) and Section IN ('formations') order by Posted desc limit 0, 1]
			[/attribute]
		<txp:if_variable name="has_articles" value="">
			[<txp:if_variable name="has_articles" value="">: true]
		</txp:if_variable>
		<txp:variable name="has_articles" value='<txp:article_custom section=''<txp:section />'' category=''<txp:category />'' limit="1" />'/>
			[attribute 'value']
			<txp:article_custom section='<txp:section />' category='<txp:category />' limit="1" />
				[attribute 'section']
				<txp:section />
				[/attribute]
				[attribute 'category']
				<txp:category />
				[/attribute]
				[SQL (0,00051307678222656): select *, unix_timestamp(Posted) as uPosted, unix_timestamp(Expires) as uExpires, unix_timestamp(LastMod) as uLastMod from textpattern where 1=1 and Status = 4 and Posted <= now() and (now() <= Expires or Expires = '0000-00-00 00:00:00') and (Category1 IN ('electricite') or Category2 IN ('electricite')) and Section IN ('formations') order by Posted desc limit 0, 1]
			[/attribute]
		<txp:if_variable name="has_articles" value="">
			[<txp:if_variable name="has_articles" value="">: true]
		</txp:if_variable>
		<txp:variable name="has_articles" value='<txp:article_custom section=''<txp:section />'' category=''<txp:category />'' limit="1" />'/>
			[attribute 'value']
			<txp:article_custom section='<txp:section />' category='<txp:category />' limit="1" />
				[attribute 'section']
				<txp:section />
				[/attribute]
				[attribute 'category']
				<txp:category />
				[/attribute]
				[SQL (0,00051403045654297): select *, unix_timestamp(Posted) as uPosted, unix_timestamp(Expires) as uExpires, unix_timestamp(LastMod) as uLastMod from textpattern where 1=1 and Status = 4 and Posted <= now() and (now() <= Expires or Expires = '0000-00-00 00:00:00') and (Category1 IN ('formations') or Category2 IN ('formations')) and Section IN ('formations') order by Posted desc limit 0, 1]
			[/attribute]
		<txp:if_variable name="has_articles" value="">
			[<txp:if_variable name="has_articles" value="">: true]
		</txp:if_variable>
		<txp:variable name="has_articles" value='<txp:article_custom section=''<txp:section />'' category=''<txp:category />'' limit="1" />'/>
			[attribute 'value']
			<txp:article_custom section='<txp:section />' category='<txp:category />' limit="1" />
				[attribute 'section']
				<txp:section />
				[/attribute]
				[attribute 'category']
				<txp:category />
				[/attribute]
				[SQL (0,00051212310791016): select *, unix_timestamp(Posted) as uPosted, unix_timestamp(Expires) as uExpires, unix_timestamp(LastMod) as uLastMod from textpattern where 1=1 and Status = 4 and Posted <= now() and (now() <= Expires or Expires = '0000-00-00 00:00:00') and (Category1 IN ('informatique') or Category2 IN ('informatique')) and Section IN ('formations') order by Posted desc limit 0, 1]
			[/attribute]
		<txp:if_variable name="has_articles" value="">
			[<txp:if_variable name="has_articles" value="">: true]
		</txp:if_variable>
		<txp:variable name="has_articles" value='<txp:article_custom section=''<txp:section />'' category=''<txp:category />'' limit="1" />'/>
			[attribute 'value']
			<txp:article_custom section='<txp:section />' category='<txp:category />' limit="1" />
				[attribute 'section']
				<txp:section />
				[/attribute]
				[attribute 'category']
				<txp:category />
				[/attribute]
				[SQL (0,00055098533630371): select *, unix_timestamp(Posted) as uPosted, unix_timestamp(Expires) as uExpires, unix_timestamp(LastMod) as uLastMod from textpattern where 1=1 and Status = 4 and Posted <= now() and (now() <= Expires or Expires = '0000-00-00 00:00:00') and (Category1 IN ('intro') or Category2 IN ('intro')) and Section IN ('formations') order by Posted desc limit 0, 1]
				[article 11]
				[Module: default]
			[/attribute]
		<txp:if_variable name="has_articles" value="">
			[<txp:if_variable name="has_articles" value="">: true]
		</txp:if_variable>
		<txp:variable name="has_articles" value='<txp:article_custom section=''<txp:section />'' category=''<txp:category />'' limit="1" />'/>
			[attribute 'value']
			<txp:article_custom section='<txp:section />' category='<txp:category />' limit="1" />
				[attribute 'section']
				<txp:section />
				[/attribute]
				[attribute 'category']
				<txp:category />
				[/attribute]
				[SQL (0,00056004524230957): select *, unix_timestamp(Posted) as uPosted, unix_timestamp(Expires) as uExpires, unix_timestamp(LastMod) as uLastMod from textpattern where 1=1 and Status = 4 and Posted <= now() and (now() <= Expires or Expires = '0000-00-00 00:00:00') and (Category1 IN ('magazine') or Category2 IN ('magazine')) and Section IN ('formations') order by Posted desc limit 0, 1]
				[article 13]
				[Module: default]
			[/attribute]
		<txp:if_variable name="has_articles" value="">
			[<txp:if_variable name="has_articles" value="">: true]
		</txp:if_variable>
		<txp:variable name="has_articles" value='<txp:article_custom section=''<txp:section />'' category=''<txp:category />'' limit="1" />'/>
			[attribute 'value']
			<txp:article_custom section='<txp:section />' category='<txp:category />' limit="1" />
				[attribute 'section']
				<txp:section />
				[/attribute]
				[attribute 'category']
				<txp:category />
				[/attribute]
				[SQL (0,00051498413085938): select *, unix_timestamp(Posted) as uPosted, unix_timestamp(Expires) as uExpires, unix_timestamp(LastMod) as uLastMod from textpattern where 1=1 and Status = 4 and Posted <= now() and (now() <= Expires or Expires = '0000-00-00 00:00:00') and (Category1 IN ('mecanique') or Category2 IN ('mecanique')) and Section IN ('formations') order by Posted desc limit 0, 1]
			[/attribute]
		<txp:if_variable name="has_articles" value="">
			[<txp:if_variable name="has_articles" value="">: true]
		</txp:if_variable>
		<txp:variable name="has_articles" value='<txp:article_custom section=''<txp:section />'' category=''<txp:category />'' limit="1" />'/>
			[attribute 'value']
			<txp:article_custom section='<txp:section />' category='<txp:category />' limit="1" />
				[attribute 'section']
				<txp:section />
				[/attribute]
				[attribute 'category']
				<txp:category />
				[/attribute]
				[SQL (0,00051307678222656): select *, unix_timestamp(Posted) as uPosted, unix_timestamp(Expires) as uExpires, unix_timestamp(LastMod) as uLastMod from textpattern where 1=1 and Status = 4 and Posted <= now() and (now() <= Expires or Expires = '0000-00-00 00:00:00') and (Category1 IN ('pratique') or Category2 IN ('pratique')) and Section IN ('formations') order by Posted desc limit 0, 1]
			[/attribute]
		<txp:if_variable name="has_articles" value="">
			[<txp:if_variable name="has_articles" value="">: true]
		</txp:if_variable>
		<txp:variable name="has_articles" value='<txp:article_custom section=''<txp:section />'' category=''<txp:category />'' limit="1" />'/>
			[attribute 'value']
			<txp:article_custom section='<txp:section />' category='<txp:category />' limit="1" />
				[attribute 'section']
				<txp:section />
				[/attribute]
				[attribute 'category']
				<txp:category />
				[/attribute]
				[SQL (0,00051188468933105): select *, unix_timestamp(Posted) as uPosted, unix_timestamp(Expires) as uExpires, unix_timestamp(LastMod) as uLastMod from textpattern where 1=1 and Status = 4 and Posted <= now() and (now() <= Expires or Expires = '0000-00-00 00:00:00') and (Category1 IN ('premier-degre') or Category2 IN ('premier-degre')) and Section IN ('formations') order by Posted desc limit 0, 1]
			[/attribute]
		<txp:if_variable name="has_articles" value="">
			[<txp:if_variable name="has_articles" value="">: true]
		</txp:if_variable>
	</txp:category_list>
<txp:article_custom section="formations" category="magazine" wraptag="ul" form="menu_articles"  sort="custom_1 asc, posted desc"/>
	[SQL (0,0006110668182373): select *, unix_timestamp(Posted) as uPosted, unix_timestamp(Expires) as uExpires, unix_timestamp(LastMod) as uLastMod from textpattern where 1=1 and Status = 4 and Posted <= now() and (now() <= Expires or Expires = '0000-00-00 00:00:00') and (Category1 IN ('magazine') or Category2 IN ('magazine')) and Section IN ('formations') order by custom_1 asc, posted desc limit 0, 10]
	[article 13]
	[SQL (0,00016498565673828): select Form from txp_form where name='menu_articles']
	[Module: menu_articles]
	<txp:permlink>
		<txp:title/>
	</txp:permlink>
	[article 12]
	[Module: menu_articles]
	<txp:permlink>
		<txp:title/>
	</txp:permlink>
	[article 10]
	[Module: menu_articles]
	<txp:permlink>
		<txp:title/>
	</txp:permlink>
<txp:output_form form="agenda_pieddepage"/>
	[SQL (0,00033783912658691): select Form from txp_form where name='agenda_pieddepage']
	[Module: agenda_pieddepage]
	<txp:output_form form="agenda_panel"/>
		[SQL (0,00036787986755371): select Form from txp_form where name='agenda_panel']
		[Module: agenda_panel]
[ ~~~ secondpass ~~~ ]
 -->

Offline

#11 2010-06-05 13:59:13

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

Re: categories not listed in a section

jpdupont wrote:

Now, it works if I put a <txp:title /> in the empty default form …
It seems that the default form must be filled with a txp tag … Bug ???

No, of course that is not a bug. <txp:article /> and <txp:article_custom /> when used as a single tag and without the form attribute will use form ‘default’. If that form is empty, of course there is no output, so your variable’s value is empty.
The tag trace shows that you’re using the single article_custom tag, and it is finding articles, still the variable’s value is empty. I can’t make anything else out of this than that form ‘default’ is empty…

And I must have been sleeping when I posted the code because it still was wrong :( Try this:

<txp:variable name="has_articles" value='<txp:article_custom section=''<txp:section />'' category=''<txp:category />'' limit="1"><txp:title /></txp:article_custom>' />

Offline

#12 2010-06-05 16:43:44

jpdupont
Member
Registered: 2004-10-01
Posts: 752

Re: categories not listed in a section

Your code is ok now with an empty default form.
Thanks Els !

Offline

Board footer

Powered by FluxBB