Textpattern CMS support forum

You are not logged in. Register | Login | Help

#21 2006-11-06 08:21:37

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

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

#23 2006-12-04 22:44:20

simmerdesign
Member
From: Eden Prairie, MN
Registered: 2006-01-03
Posts: 19
Website

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
Admin
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
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

#26 2007-01-17 20:40:58

dada78
Member
From: New York
Registered: 2005-10-27
Posts: 138
Website

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
Admin
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

#28 2007-07-29 11:20:24

RedFox
Member
From: Netherlands
Registered: 2005-03-25
Posts: 740
Website

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
Admin
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

#30 2007-07-29 17:32:28

wet
Developer
From: Lenzing, Austria
Registered: 2005-06-06
Posts: 3,267
Website

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

Board footer

Powered by FluxBB