Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#16 2006-05-11 00:41:48
- Logoleptic
- Plugin Author

- From: Kansas, USA
- Registered: 2004-02-29
- Posts: 482
Re: [plugin] [ORPHAN] chh_if_data
Suggested enhancement
Support testing more than one Txp tag per <txp:chh_if_data> block; provide something like a comparison attribute that can be set to “and” or “or” for the following effect:
comparison="or"— plugin returns “true” if any of the enclosed tags produce datacomparison="and"— plugin returns “true” if all of the enclosed tags produce data
Thanks for all the cool plugins. Keep up the awesome work. :-)
Offline
Re: [plugin] [ORPHAN] chh_if_data
charisomp: there’s an if_variable that works for jmc_event_manager
BE + MEngSc = engineer with a side dish of frustrated designer/developer with a penchant for photography outside
Offline
#18 2006-11-06 00:24:28
- scdoody
- Member
- Registered: 2006-10-18
- Posts: 129
Re: [plugin] [ORPHAN] chh_if_data
I uploaded the plugin and added the plugin code to my site. But I get this message:
tag_error <txp:chh_if_data> -> Textpattern Warning: unknown_tag: chh_if_data on line 968
I assume the unknown_tag is because there is something wrong with the plugin upload? How do I know if the plugin was installed correctly?
Thanks!
Offline
Re: [plugin] [ORPHAN] chh_if_data
This may sound silly, but did you double check that it was enabled?
Offline
#20 2006-11-06 01:16:39
- scdoody
- Member
- Registered: 2006-10-18
- Posts: 129
Re: [plugin] [ORPHAN] chh_if_data
I checked and it says that it installed correctly. Here is my code on my mail default display page:
<txp:article limit=“4” />
<txp:chh_if_data>
<txp:if_individual_article >
<p><txp:link_to_prev><txp:prev_title /></txp:link_to_prev>
<txp:link_to_next><txp:next_title /></txp:link_to_next></p>
<txp:else />
<p style=“float:right; padding:0px 0px 15px 0px;”><txp:older><txp:text item=“Next Page >>” /></txp:older> </p>
<p style=“float:left;”><txp:newer><txp:text item=”<< Previous Page”/></txp:newer></p>
</txp:if_individual_article>
<txp:else />
<p>article_custom had nothing to say.</p>
</txp:chh_if_data>
Any thoughts on why I am getting the unknown tag error of:
tag_error <txp:chh_if_data> -> Textpattern Warning: unknown_tag: chh_if_data on line 968
Thanks.
Offline
Re: [plugin] [ORPHAN] chh_if_data
You should enclose just one tag with chh_if_data to make sure, the plugin works properly.
The example you mention above can be easily done with if_individual_artile and if_articlelist. This are two tags that come out-of-the-box along with textpattern
Offline
#22 2006-11-08 03:24:20
- scdoody
- Member
- Registered: 2006-10-18
- Posts: 129
Re: [plugin] [ORPHAN] chh_if_data
I did a test and know that the plugin is now enabled and installed correctly.
However, I am having trouble understanding where I am supposed to position my code within the chh_if_data. Here is what I have so far. In the code below, I have a block at the bottom commented out – I want this text to display when a category does not have any articles. So for example, if someone is on the homepage of my blog and then clicks a category with no articles, the ‘no articles . . .“message would display.
Please let me know where I should position the chh_if_data code to make this happen. I’ve tried a number of times but I haven’t found a good solution.
<!—- center—->
<div id=“contenthome”>
<txp:article limit=“8” />
<txp:if_individual_article >
<p><txp:link_to_prev><txp:prev_title /></txp:link_to_prev></p>
<p><txp:link_to_next><txp:next_title /></txp:link_to_next></p>
<txp:else />
<p style=“float:left;”><txp:newer><txp:text item=”<< Previous Page”/></txp:newer></p>
<p style=“float:right; padding:0px 0px 15px 0px;”><txp:older><txp:text item=“Next Page >>” /></txp:older> </p>
</txp:if_individual_article>
<!—-<h3 style=“font-family: Arial, Helvetica, sans-serif; font-size:1.5em; text-transform:uppercase; color:#DB0455;”><txp:category /></h3>
<p>There are not any articles in this category yet.</p>
<p> If you know of a stylish and modern product or service that you think we should feature, please <a href=“http://www.stylemodern.com/index_test.php?s=Conotact”>contact us</a>. </p> —->
</div>
Offline
Re: [plugin] [ORPHAN] chh_if_data
I’m in the same boat – can’t figure out where to put the chh_if_data tags to produce the “no articles” response. I’d love a peek at someone’s working example.
Offline
#24 2006-12-05 16:31:24
- els
- Moderator

- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: [plugin] [ORPHAN] chh_if_data
This should work:
<txp:chh_if_data>
<txp:article limit="8" />
<txp:else />
<h3 style="font-family: Arial, Helvetica, sans-serif; font-size:1.5em; text-transform:uppercase; color:#DB0455;"><txp:category /></h3>
<p>There are not any articles in this category yet.</p>
<p> If you know of a stylish and modern product or service that you think we should feature, please <a href="http://www.stylemodern.com/index_test.php?s=Conotact">contact us</a>. </p>
</txp:chh_if_data>
Remember not to wrap more than one txp tag in the chh_if_data tags.
Offline
#25 2007-01-05 08:46:48
- marios
- Archived Plugin Author

- Registered: 2005-03-12
- Posts: 1,253
Re: [plugin] [ORPHAN] chh_if_data
I am missing the functionality to have it return false, when only one condition returns false ( for multi-tag usage)
Is anyone else still interested in this ( to extend this plugin ) ?
regards, marios
⌃ ⇧ < ⎋ ⌃ ⇧ >
Offline
Re: [plugin] [ORPHAN] chh_if_data
takshaka wrote:
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.
—> I can’t get the plug-in to return “No articles found” and have the following code in my search_results form:
<code><txp:chh_if_data>
<p>Here’s an article list containing your search inquiry</p>
<p><txp:search_result_title /></p>
<txp:else />
<p>No articles found</p>
</txp:chh_if_data></code>
All I get are the search results. Which at least is a beginning. ;-)
Any advice?
Thanks!
Dada
Last edited by dada78 (2007-01-17 20:41:24)
Offline
#27 2007-01-17 23:26:27
- els
- Moderator

- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: [plugin] [ORPHAN] chh_if_data
Try this:
On the page:
<txp:if_search>
<txp:chh_if_data>
<p>Here’s an article list containing your search inquiry</p>
<txp:article />
<txp:else />
<p>No articles found</p>
</txp:chh_if_data>
</txp:if_search>
In form search_results:
<p><txp:search_result_title /></p>
Offline
Re: [plugin] [ORPHAN] chh_if_data
Why doesn’t this work in form: ‘search_results’?
<txp:chh_if_data>
<div class="search">
<h4><txp:permlink><txp:title /></txp:permlink></h4>
<p><txp:search_result_excerpt /></p>
<txp:else />
<h4>Oops ... no results!</h4>
<p>Try another search ... :)</p>
</div>
</txp:chh_if_data>
Last edited by RedFox (2007-07-29 11:21:47)
Offline
#29 2007-07-29 13:48:05
- els
- Moderator

- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: [plugin] [ORPHAN] chh_if_data
RedFox wrote:
Why doesn’t this work in form: ‘search_results’?
Because as far as I know you can only use one txp tag inside chh_if_data (otherwise it won’t know which tag to check for data).
Offline
Re: [plugin] [ORPHAN] chh_if_data
For the conditional display of content depending on the result of a search try rss_if_search_results.
Offline