You are not logged in.
Hi,
I changed the field name and options to all lower case and it works (without jakob’s filter).
Not sure why.. but I’m happy :)
Thanks for your help!
Offline
For the record (and maybe for the help documents too).
id is always the id of current page’s article (i.e. the id of current individual article)thisid is the id of current context article. For example, in an article_custom loop, thisid takes the value of the article currently being iterated.For example, if you need to simulate txp:if_article_id, using smd_if, it would be like this:
<txp:smd_if field="thisid" operator="eq" value="?id">
The advantage of this one over txp:if_article_id is that you could check for other conditions, using logic="OR".
Offline
I’m not sure if I understand how the parent value for field attribute works. I’m not even sure if I needed for what I’m trying to achieve:
Is it possible to test if current (global) category has no children? I don’t think I need to traverse up the category tree for that, but I may be missing something.
Offline
Hi, a quick question.
How I should use it if I want to know if a body or excerpt article has content or not ?
I was using <txp:chh_if_data> but it does not work / comply when the output is less than 39 characters :| (unless when I’m displaying articles from a specific category)
<txp:chh_if_data>
<txp:article_custom form="body" pgonly="0" limit="1" section='<txp:section />' sort="Posted asc" status="5" category='<txp:category title="0" />' />
<txp:else/>
<p>NO THERE CONTENT IN BODY ARTICLE</p>
</txp:chh_if_data>
Thanks
Last edited by gfdesign (2012-12-12 14:56:31)
Offline
Without plugin?
<txp:variable name="checkcheck"><txp:article_custom form="body" limit="1" section='<txp:section />' sort="Posted asc" status="sticky" category='<txp:category title="0" />' /></txp:variable>
<txp:if_variable name="checkcheck" value="">
<p>NO THERE CONTENT IN BODY ARTICLE</p>
<txp:else/>
<txp:variable name="checkcheck" />
</txp:if_variable>
status 5 is sticky, right? (No further proofreading done.)
Last edited by uli (2012-12-12 21:19:33)
In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links
Offline
Or:
<txp:if_custom_field name="body">
something
<txp:else />
other thing
</txp:if_custom_field>
Offline
uli dijo:
Without plugin?
status 5 is sticky, right? (No further proofreading done.)
Yes, I use an sticky article just to describe different categories. About your code, it works! but I’ve modified it as follows:
<txp:variable name="checkcheck"><txp:article_custom form="body" limit="1" section='<txp:section />' sort="Posted asc" status="sticky" category='<txp:category title="0" />' /></txp:variable>
<txp:if_variable name="checkcheck" value="">
<p>NO THERE CONTENT IN BODY ARTICLE</p>
<txp:else/>
<txp:variable name="checkcheck" />
</txp:if_variable>
I thought I couldn’t store big chains text in a TXP variable :P
Many thanks
Offline
gfdesign wrote:
but I’ve modified it as follows:
Ah, the slash in the closing variable tag. Glad it didn’t make you stumble. Will correct that above.
I thought I couldn’t store big chains text in a TXP variable :P
Me neither, but I learnt it even spares one query.
In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links
Offline
GugUser dijo:
Or:
bq. <txp:if_custom_field name=“body”> something
<txp:else /> other thing
</txp:if_custom_field>
In this case, I’m not using custom_field
I wondered with body or excerpt texts of an article.
Regards
Last edited by gfdesign (2012-12-12 21:24:39)
Offline
The example checks the body field.
Offline