Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
[plugin] [ORPHAN] chh_if_data
This tag may be used to determine whether some contained Txp tags output any data, allowing the conditional output of accompanying static markup, like a header or a “no articles found” message.
<txp:chh_if_data>
<h3>Here's an article list</h3>
<txp:article_custom category="Nogo" />
<txp:else />
<p>article_custom had nothing to say.</p>
</txp:chh_if_data>
Offline
#2 2006-01-21 10:34:21
- nardo
- Member
- From: tuvalahiti
- Registered: 2004-04-22
- Posts: 743
Re: [plugin] [ORPHAN] chh_if_data
man you’re on fire!
thank you
Offline
Re: [plugin] [ORPHAN] chh_if_data
Yesss ! Thanks, a lot.
Offline
#4 2006-01-21 10:52:15
- lee
- Member
- From: Normandy, France
- Registered: 2004-06-17
- Posts: 831
Re: [plugin] [ORPHAN] chh_if_data
Very smart and useful. Thanks.
Offline
Re: [plugin] [ORPHAN] chh_if_data
most useful plugin to come out this year (so far), thanks! :)
Offline
Re: [plugin] [ORPHAN] chh_if_data
this solves something that I’ve been wishing I’d thought of for a while now. when you have no results for a search, it outputs a blank page. now, when there’s no matching keywords from a search, I can put in there:
No Search Results Found
Please try another search
just wrap it around the if_individual_article txp tag. thanks!
Fine then, I’ll just make a hit counter myself.
Offline
Re: [plugin] [ORPHAN] chh_if_data
Thank you for this lovely plugin!
Offline
Re: [plugin] [ORPHAN] chh_if_data
Thanks, definitely useful. I employ it to conditionally show article thumbs or a neutral placeholder image depending on their presence.
Robert
Offline
Re: [plugin] [ORPHAN] chh_if_data
I wanted to use this plugin to control the output the category links, because when I don’t assign a category2 it outputs an empty a
element, and I don’t want that to happen.
So I need something along these lines: if there is a category2 assigned output it, if there isn’t, output nothing. Can this be done?
Offline
Re: [plugin] [ORPHAN] chh_if_data
Very, very useful. But it breaks (for me) with your <code>chh_related_articles</code> plugin.
This is my code:
<code>
<txp:chh_if_data>
<div class=“events”>
<h3>Aktuelle Termine von <txp:title /></h3>
<ul>
<txp:chh_related_articles form=“event” time=“future” relation=“keywords” section=“Veranstaltungen” custommode=“list” />
</ul>
</div> <!— /.events —>
<txp:else />
<p>Zur Zeit liegen uns keine Termine vor.</p>
</txp:chh_if_data>
</code>
Ahhh, wait …. I see … ;-)
I use two TXP-Tags inside <code>chh_if_data</code>. May be there could be something like this:
<code><txp:chh_if_data tag=“chh_related_articles”></code>
But even without this, it is a useful plugin. Thanks for this.
Last edited by Freshmango (2006-02-12 16:50:05)
<a href=“http://dennisfrank.info” title=“Dennis Frank gestaltet – Portfolio” style=“display: block; background:#efefef; color: #545454; float: left; padding: .5em; border: 1px none #9f9f9f; text-decoration: none;”><span style=“border-bottom: 1px solid #9f9f9f;”>Dennis Frank portfolio</span></a>
Offline
#11 2006-04-21 19:07:02
- chariscomp
- Member
- Registered: 2006-03-02
- Posts: 14
Re: [plugin] [ORPHAN] chh_if_data
Hello,
I am running into a problem with this plugin. I am attempting to use this plugin with another plugin, jmc_event_manager. The relevant portion of my form code looks like this:
<code>
<txp:chh_if_data>
<br />
<txp:jmc_venue_address1 /><br />
</txp:chh_if_data>
<txp:chh_if_data>
<txp:jmc_venue_suburb />,
</txp:chh_if_data>
<txp:chh_if_data>
<txp:jmc_venue_state />
</txp:chh_if_data>
</p>
</code>
After some debugging, it appears that the output of the jmc_venue_* tags are being parsed even before the chh_if_data can process it unparsed. I.e. when I use dmp on the value of $thing, I get the value of that field. For example, say venue_address1 for this record is equal to “400 Mont Clair” with some HTML formatting. When I use dmp, I get “400 Mont Clair” not
<code>
<txp:jmc_venue_address1 /><br />
</code>
which is what I am expecting to get. The error I am getting is that it always says there is no data even when there is. Best I can figure out, it is because the output is being parsed before it can be compared unparsed and parsed. Does anyone have any suggestions on how to fix this problem?
Offline