Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#1 2009-11-26 10:39:17
- Gallex
- Member
- Registered: 2006-10-08
- Posts: 1,315
different output depending on article existence
if there is article(s) in specific section display this else display nothing . can’t figure out myself…
Offline
Offline
#3 2009-11-26 11:29:21
- Gallex
- Member
- Registered: 2006-10-08
- Posts: 1,315
Re: different output depending on article existence
this code outputs nothing.
the specific section name is special and there is articles now.
Offline
Re: different output depending on article existence
It should output either Ain’t or Is. Can’t be nothing. What do you see?
Offline
#5 2009-11-26 13:02:51
- Gallex
- Member
- Registered: 2006-10-08
- Posts: 1,315
Re: different output depending on article existence
i did put my code into wrong part, sorry. ;) yes, it’s working. but…
it still outputs the title h6 part if there is no articles in this section
my form
<txp:variable name="hasarticles" value='<txp:article_custom section=''<txp:section />'' limit="1" />' />
<txp:if_variable name="hasarticles" value="">
<txp:else />
<h6 class="eripakkumised">Eripakkumised</h6>
<txp:article_custom form="eripakkumised" limit="5" section="eripakkumised" />
</txp:if_variable>
Offline
#6 2009-11-26 17:31:22
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: different output depending on article existence
Are you displaying this on another section’s page? The first and the second article_custom tag should point to the same section, otherwise it’s testing for content in a different section ;) So either change the section
attribute in the first tag to section="eripakkumised"
, or – if you need this for all ‘current’ sections – change the second one to section='<txp:section />'
.
Offline
#7 2009-11-27 11:31:03
- Gallex
- Member
- Registered: 2006-10-08
- Posts: 1,315
Re: different output depending on article existence
the first suggestion works perfectly!m thank you all!
Offline