Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#85 2006-02-05 02:41:35

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

Re: [plugin] [ORPHAN] chh_article_custom

Odd.

  • Where are you using the tag: page template, output form, or article form? (not that it should matter)
  • What attributes are you using — that is, the exact tag?
  • Does a plain <txp:chh_article /> or <txp:chh_article_custom /> output anything?
  • Can you post a tag trace for a page where the tag(s) output nothing? If you do, please use pastebin.com so we don’t clog up this thread.

Offline

#86 2006-02-05 05:38:16

theonlydrew
Member
Registered: 2006-01-10
Posts: 21

Re: [plugin] [ORPHAN] chh_article_custom

Okay, I put both article and article_custom, my tag trace is at this pastebin address: <a href=“http://pastebin.com/539638”>http://pastebin.com/539638</a>

I tried a blank section and page called resources that has plenty of articles that list via regular txp:article txp:article_custom tags.

in this particular tagtrac i had the blank section and page that inlcuded both txp:chh_article and txp:chh_article_custom just plain and then another set of these using:
1. txp:chh_article time=“past”
2. txp:chh_article_custom time=“past” limit=“10” listform=“resourcelist”

So. check it out! And THanks so much for responding! If I can get this plugin working then I’ll be rockin and rollin. I especially need the multiple section function. By the by if I list multiple sections articles with the txp:chh_article_custom, will it display them (assuming i assign a form=“whateverSingleform”) individually within that section? Or will it go back to the section the articles are from? Thanks again!

Last edited by theonlydrew (2006-02-05 05:41:25)

Offline

#87 2006-02-05 19:51:54

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

Re: [plugin] [ORPHAN] chh_article_custom

Aha. Hoho.

Judging by the SQL generated, you have a custom field named “Time”. If you don’t have such a custom field, then I’ve managed to break something in a spectacularly new and unusual manner. But I’ll assume you do.

First, the fix:

Now, the tedious explanation, which you can safely skip:

chh_article_custom lets you use custom fields in the same way as the keywords field, so if you specify <txp:chh_article_custom Dog="doberman" />, the tag will return only articles where the custom field named “Dog” contains the text “doberman”.

This isn’t unique to the plugin. txp:article(_custom) does the same thing — theoretically. However, there is a bug in the Txp core that prevents txp:article(_custom) from recognizing custom field names that contain any capital letters (renaming the custom field to “time” should cause txp:article to fail as well whenever time="past" is specified).

The workaround used by chh_article_custom is to ignore custom field case entirely, so Dog="doberman" will look for a custom field named “Dog”, “dog”, “dOg”, etc.. Likewise, when the tag encounters an attribute like time="past", it will check for a custom field named “time”, “Time”, “tImE”, etc.. Since you have no articles where the “Time” field contains “past”, no articles are returned.

Having said all of that, the custom-fields-as-attributes feature is actually broken in v1.14. Were it not, simply removing the time attribute from the tag would be enough to make things work.

theonlydrew wrote:
By the by if I list multiple sections articles with the txp:chh_article_custom, will it display them (assuming i assign a form=“whateverSingleform”) individually within that section? Or will it go back to the section the articles are from? Thanks again!

A single article on its permlinked page will always use the section assigned to it on the content > write page.

Offline

#88 2006-02-06 03:01:10

theonlydrew
Member
Registered: 2006-01-10
Posts: 21

Re: [plugin] [ORPHAN] chh_article_custom

yes, I did have a custom field named “Time”, and your new version definitely did the trick! Thanks so much, the plugin works great now. Thanks for you hard work.

Offline

#89 2006-02-08 06:00:08

theonlydrew
Member
Registered: 2006-01-10
Posts: 21

Re: [plugin] [ORPHAN] chh_article_custom

What about including override=“form” in chh_article_custom. It would respect individual article’s specific overrides, but allow all those listed in the article_custom to use the override specified in the tag. Does that make sense?

slap me if being stupid, but wouldn’t it be a cool feature to add.

Offline

#90 2006-02-20 22:51:00

pieman
Member
From: Bristol, UK
Registered: 2005-09-22
Posts: 491
Website

Re: [plugin] [ORPHAN] chh_article_custom

@ takshaka
thanks for your reply in the “rss_suparchive – article archive list” thread

I’m using Textpattern version: 4.0.2 (r1076)
and I’m trying to use chh_article_custom to display future articles from two particular categories,

<code><ul class=“eventList”> <txp:chh_article_custom form=“rss_suparchive_countdown” section=“events” category=“BMF-event,SWS” /> </ul> </code>

but I get this error:
“Fatal error: Call to undefined function: chh_sql_category() in /home/pieman/public_html/clients/BMF/admin/lib/txplib_misc.php(455) : eval()’d code on line 211”

can you tell… is there a bug or am I using it incorrectly?

Offline

#91 2006-02-21 06:15:32

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

Re: [plugin] [ORPHAN] chh_article_custom

It looks like you haven’t installed chh_article_lib, which is required for the plugin to function. You may not have noticed the requirement if you clicked a download link from somewhere other than the chh_article_custom info page (I see I haven’t put that info in the plugin help text either).

In case of a missing library, Txp is supposed to throw an error that says 'A problem occured while loading the plugin: chh_article_custom -> User_Error: Unable to include required plugin "chh_article_lib" on line 392' — but for some reason require_plugin() fails silently in this case. Not sure why.

Offline

#92 2006-02-21 10:32:19

pieman
Member
From: Bristol, UK
Registered: 2005-09-22
Posts: 491
Website

Re: [plugin] [ORPHAN] chh_article_custom

takshaka, I salute you :)

Offline

#93 2006-02-21 22:36:18

rbe
Member
Registered: 2006-02-12
Posts: 27
Website

Re: [plugin] [ORPHAN] chh_article_custom

takshaka, quick question for you… I’m using chh_article_custom on my site (and love it!). I’m trying to get paging to work right now and its not working too well… I’m using the <code><txp:older/></code> and <code><txp:newer/></code> tags in a misc form for the paging links… I’ve got a bunch of content that “could” show up on the home page; however, due to the limit on my chh_tag I’m not showing them all and would like to have paging turned on.
Here is a code snippet from my default page template that shows the “default” section area… Once paging is working, I’ll have to add an “if paging” block that class chh_article_custom with different parms… Let me know if I did something wrong, thanks!!!

<code>
<txp:ob1_if_section section=“default”> <txp:glx_if_category_list> <h2 class=“categorytitle”><txp:category title=“1”/> category</h2> </txp:glx_if_category_list> <!— force the first “family” article onto the page —> <txp:glx_if_not_category_list> <txp:chh_article_custom form=“family_home” listform=“family_home” section=“family” limit=“1” sortord=“asc” /> </txp:glx_if_not_category_list> <!— show the first non-family article in full —> <txp:chh_article_custom form=“default” listform=“default” category=”?” section=“article,pictures” limit=“1” sortord=“asc” /> <!— show the next four in “small” —> <txp:chh_article_custom form=“default_collapsed” listform=“default_collapsed” category=”?” section=“article,pictures” limit=“4” sortord=“asc” offset=“1” /> <!— this should show the paging links —> <txp:output_form form=“postnavigation” /> <!— TODO: Somewhere in here determine if we are on a page other than 1, and change what shows up…. —>
</txp:ob1_if_section>
</code>

postnavigation form
<code>
<div class=“prev_next_nav”>
<txp:older>&lt;&lt; – previous posts</txp:older> &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; <txp:newer>newer posts + &gt;&gt;</txp:newer>
<br /><br />
</div>
</code>

Offline

#94 2006-02-22 04:31:27

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

Re: [plugin] [ORPHAN] chh_article_custom

You need to use the chh_article tag for paging to work. The chh_article_custom tag, like txp:article_custom, does not do it.

In your case, I think you only need to replace the last chh_article_custom tag, adding the pageby attribute to make sure it counts every five pages instead of every four:

<code><txp:chh_article form=“default_collapsed” listform=“default_collapsed” category=”?” section=“article,pictures” limit=“4” sortord=“asc” offset=“1” pageby=“5” />
</code>

Last edited by takshaka (2006-02-22 04:32:35)

Offline

#95 2006-02-22 05:56:41

rbe
Member
Registered: 2006-02-12
Posts: 27
Website

Re: [plugin] [ORPHAN] chh_article_custom

thanks takshaka… That’s got it working a little better… Right now I have about 10 articles that should show up on the page (with paging etc…) In order to get anything to show up at all I had to chagne the limit to 3, pageby to 4 and then I’m only getting 1 article on page 2… I’ll play around with it a bit more and switch a few more tags to see if I can figure something out. I really appriciate the help!

Any thoughts on what the problem might be?

looks like the problem is with the second section <code>section=“articles,pictures”</code>… only items from the articles section are showing up, items in the pictures section are not

Last edited by rbe (2006-02-22 06:10:52)

Offline

#96 2006-02-22 17:59:43

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

Re: [plugin] [ORPHAN] chh_article_custom

I was wrong about only needing one chh_article tag. Both of the last two need to be chh_article, and both of them need to have the same pageby attribute.

BTW— There is no sortord attribute; it should be sortdir instead.

The following tags work correctly for me:

<code><txp:chh_article listform=“default” category=”?” section=“article,pictures” limit=“1” sortdir=“asc” pageby=“5” />
<txp:chh_article listform=“default_collapsed” category=”?” section=“article,pictures” limit=“4” sortdir=“asc” offset=“1” pageby=“5” />
</code>

rbe wrote:
looks like the problem is with the second section <code>section=“articles,pictures”</code>… only items from the articles section are showing up, items in the pictures section are not

I can’t reproduce this behavior.

If you want, post a tag trace at pastebin.com (or two traces actually, one for the first page and one for page two) so I can see what sort of SQL is being generated.

Offline

Board footer

Powered by FluxBB