Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#97 2006-02-22 18:28:12

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

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

#98 2006-02-23 06:23:49

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

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

#99 2006-02-23 06:34:19

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

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

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,752
Website

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

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

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

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,752
Website

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

tinyfly
Member
From: Dallas, Texas
Registered: 2004-05-10
Posts: 462
Website

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)

Offline

#106 2006-03-27 02:24:40

Gena Wenli
Member
From: Ohio, USA
Registered: 2006-01-26
Posts: 34

Re: [plugin] [ORPHAN] chh_article_custom

I don’t know why it wasn’t working before, but I changed the organization from category to section. And now it works. Thanks for help.

G

Offline

#107 2006-03-28 23:03:10

tinyfly
Member
From: Dallas, Texas
Registered: 2004-05-10
Posts: 462
Website

Re: [plugin] [ORPHAN] chh_article_custom

I am looking over your time attribute and I am not sure if I can make it do what I need. I am creating a site for high school debaters and every year in april we switch topics which has articles that belong to it. What I am trying to do is automate the switching of topics.

I guess I would need something like, month=“april to march” so it would show any articles from say this april through next march, 12 months apart. Is something like this even possible?

Offline

#108 2006-03-30 00:48:36

nardo
Member
From: tuvalahiti
Registered: 2004-04-22
Posts: 743

Re: [plugin] [ORPHAN] chh_article_custom

is it possible with chh_article_custom or chh_article to display all articles in a section EXCEPT those which have the category “current” ?

edit: a solution

it’s as easy as using <txp:if_article_category><txp:else /> … within an article form

Last edited by nardo (2006-04-10 01:08:13)

Offline

Board footer

Powered by FluxBB