Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
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
Re: [plugin] [ORPHAN] chh_article_custom
takshaka, I salute you :)
Offline
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><< – previous posts</txp:older> <txp:newer>newer posts + >></txp:newer>
<br /><br />
</div>
</code>
Offline
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
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
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
Re: [plugin] [ORPHAN] chh_article_custom
Thanks takshaka… I dropped the tag trace into pastebin.. I think I also found the problem in that trace.. It looks like the sql being generated is: <code>select *, unix_timestamp(Posted) AS uPosted from `textpattern` where 1 and Status=‘4’ AND Posted < now() AND ( (Section = ‘article’) OR (Section = ‘pictures’) ) and Section != ‘about’ and Section != ‘archivescat’ and Section != ‘archivesmonth’ and Section != ‘contact’ and Section != ‘pictures’ and Section != ‘links’ and Section != ‘search’ and Section != ‘disclaimer’ ORDER BY Posted asc LIMIT 0, 1</code>
Notice the <code>Section = ‘pictures’</code> and then a bit later the <code>Section != ‘pictures’</code>
I dropped the rest of the tag trace at pastebin 567142 – thanks for all of your help!!! I really appriciate it… I’m new to PHP, but have been coding for a long time, so I’ll see what I can figure out from a quick dive in the code… no promises – I’m still in the mode of looking up every function to figure out what it’s supposed to do :)
Offline
Re: [plugin] [ORPHAN] chh_article_custom
and Section != 'about' and Section != 'archivescat' and Section != 'archivesmonth' and Section != 'contact' and Section != 'pictures' and Section != 'links' and Section != 'search' and Section != 'disclaimer'
Okay, that settles it. This is generated by filterFrontPage(). chh_article operates like txp:article as much as possible, which means it won’t display sections on the home page that have ‘On front page?’ set to ‘no’ on the presentation > sections tab.
This is one of those things that I sort of left as-is coming from txp:article. Now that I actually see it in action, I realize it would make a lot more sense to have frontpage filtering disabled whenever the section attribute is used. After all, the purpose of frontpage filtering in txp:article, where the section is always derived from context, is to list articles from all of the allowed sections on the home page. If you are specifying sections in the tag itself, you obviously want to use those sections and only those sections.
I’ll add that to my todo list. In the meantime, setting the pictures section to show on the frontpage should take care of things for you.
Offline
Re: [plugin] [ORPHAN] chh_article_custom
awesome, thanks takshaka… that was indeed the problem… I didn’t even think about that… Thanks again for you quick response… I really appricate the help you’ve given where and in chh_related_article. Enjoy the rest of your week…
Offline
#100 2006-03-02 12:08:33
Re: [plugin] [ORPHAN] chh_article_custom
I’ve been using chh_article_custom to automatically generate a sitemap of several sections.
<br />
<code><dl><txp:chh_article_custom limit=“99999” listform=“sitemap” sortby=“section” sortdir=“asc” section=“a,b,c,d,e” /></dl></code>
<br />
with listform “sitemap” as follows:
<br />
<code><txp:if_different>
<dt><txp:section title=“1” /></dt>
</txp:if_different>
<dd><txp:permlink><txp:title /></txp:permlink></dd></code>
<br />
It produces a <code><dl></code>-list with <code><dt></code> section title and a list of the articles in the section as <code><dt></code> elements and works just great until I mark certain articles as sticky. Then they drop out of the sitemap list.
How do I get chh_article_custom to include articles with different status in its output?
I’ve used status=“sticky,live” with other tags (e.g. rdt_article_menu) with success but no luck here. I can’t do two chh_article_custom calls successively without the <code><dt></code> section headings duplicating, which makes nonsense of a sitemap.
Any tips on the proper notation for achieving this or alternative suggestions (or even where I should tinker with the plug-in code)?
thanks, jakob
PS: I’m using chh_article_custom 1.15 and chh_article_lib 1.04
<br />
EDIT: still no success but maybe of help in tracking it down:
Looking through the code I found the searchsticky=“1” attribute but sticky articles still do not show. I’m not sure that the searchsticky attribute makes it through the code. If I manually set it to default to <code>1</code> in the <code>$theAtts = lAtts(array(…</code> part of the plugin code it still does not work.
However if I comment out the last part of:
<code>// Status
if ($q and $searchsticky)
$statusq = “ and Status >= ‘4’”;
elseif ($id)
$statusq = “ and Status >= ‘4’”;
/* else
$statusq = “ and Status=’” . doSlash($status) . “’”;
*/</code>
then it does show sticky and live articles, but also all articles with other status-levels such as hidden and pending (which isn’t so desirable). It’s obviously not finding <code>$searchsticky</code> here.
Last edited by jakob (2006-03-02 12:59:00)
TXP Builders – finely-crafted code, design and txp
Offline
#101 2006-03-03 00:42:40
Re: [plugin] [ORPHAN] chh_article_custom
You’re just assuming I’m smarter than I am, or not as lazy. status doesn’t accept mutiple parameters. And searchsticky is for compatability with txp:article; it only applies to search results.
I’ll add multiple status params to the todo list. I should take care of it this weekend.
If you don’t want to wait that long, probably the best option for a quick hack would be to change if ($q and $searchsticky) to if ($searchsticky) Then you can use searchsticky="1" for any list, not just search results.
Just remember that you’ll need to change your tags to use status="sticky,live" when you upgrade chh_article_custom.
Offline
#102 2006-03-03 10:42:53
Re: [plugin] [ORPHAN] chh_article_custom
smart you are, lazy you are not :-) Thanks for the prompt feedback and of course I can wait the weekend.
For the moment I’ve changed the last if statement as I’m not currently using any other status searches but I’d much rather do <code>status=“sticky,live”</code> and have all options open. Thank you.
EDIT: the more I play with your plug-in the more it impresses me. Together with a little mod_rewrite for section?c= to section/category/{categoryname} and your “?” attribute it reacts wonderfully flexibly to all manner of clean-url queries. In the process, I have, however, come up against a further aspect:
May I be so bold as to make a further request? I’m using two categories, category1 in this case is “type” and category2 is location with uk, europe and worldwide as parent categories and sub-categories such as south-east, north-west, midlands etc. All the articles are assigned to a sub-category according to their location.
- doing <code>category=“uk”</code> with <code>children=“y”</code> works just great and finds all types in the uk.
- doing <code>category=“uk,type-b”</code> with <code>children=“y”</code> lists all types in the uk as well as all b-types that also occur elsewhere (correct).
- doing <code>category=“uk&type-b”</code> with <code>children=“y”</code> doesn’t find any entries but doing <code>category=“south-east&type-b”</code> does, e.g. the <code>children=“y”</code> does not work together with AND (which you do state in your attribute reference).
Would you be able to add this rather desirable combination?
Also: in such a case, how would one call this page (i.e. what kind of url, messy or otherwise). I had envisaged using two drop-down filter lists, one according to type and the other according to location.
Or: is there another way of going about it?
Last edited by jakob (2006-03-03 14:53:40)
TXP Builders – finely-crafted code, design and txp
Offline
#103 2006-03-19 21:23:01
- Gena Wenli
- Member
- From: Ohio, USA
- Registered: 2006-01-26
- Posts: 34
Re: [plugin] [ORPHAN] chh_article_custom
I’m having trouble getting <txp:chh_article_custom /> to produce anything at all.
I can set up a tag like <txp:article_custom category="cat" form="form" /> and it produces articles, but when I simply add chh_ to that snippet, I get nothing.
Any idea what’s going on?
Here’s the exact code I need to use:
<txp:chh_article_custom category="events" form="event" sortby="Posted" sortdir="asc" time="+0 days,+7 days" />
G
Last edited by Gena Wenli (2006-03-19 21:23:39)
Offline
#104 2006-03-23 02:25:06
- Gena Wenli
- Member
- From: Ohio, USA
- Registered: 2006-01-26
- Posts: 34
Re: [plugin] [ORPHAN] chh_article_custom
Please, can’t anyone help me with this?
G
Offline
#105 2006-03-25 21:53:55
Re: [plugin] [ORPHAN] chh_article_custom
Do you have the plugin turned on in the plugins tab? Do you need to use listform=”“? Do you have articles in the indicated category? What about adding a section=”“?
Last edited by tinyfly (2006-03-25 21:55:21)
Refresh Dallas and other Refreshing Cities.
Offline