Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2006-01-21 07:05:53

takshaka
Archived Plugin Author
From: Below the Manson-Nixon line
Registered: 2004-06-02
Posts: 97
Website

[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

#3 2006-01-21 10:35:26

Jeremie
Member
From: Provence, France
Registered: 2004-08-11
Posts: 1,578
Website

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

#5 2006-01-21 15:06:51

maharis
New Member
From: KL Malaysia
Registered: 2005-08-02
Posts: 9
Website

Re: [plugin] [ORPHAN] chh_if_data

most useful plugin to come out this year (so far), thanks! :)

Offline

#6 2006-01-21 23:21:12

MacStansbury
New Member
From: Georgia
Registered: 2004-12-26
Posts: 6
Website

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

#7 2006-01-23 16:20:29

The-Exit
Member
From: Berlin
Registered: 2005-07-16
Posts: 175
Website

Re: [plugin] [ORPHAN] chh_if_data

Thank you for this lovely plugin!

Offline

#8 2006-02-01 06:29:59

wet
Developer Emeritus
From: Schoerfling, Austria
Registered: 2005-06-06
Posts: 3,323
Website Mastodon

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

#9 2006-02-07 23:23:24

Dragan
Member
From: Novi Sad, Serbia
Registered: 2005-10-26
Posts: 100
Website

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

#10 2006-02-12 16:32:09

Freshmango
New Member
From: Braunschweig, Germany
Registered: 2004-06-14
Posts: 7
Website

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

Board footer

Powered by FluxBB