Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2007-02-14 21:55:07

mrdale
Member
From: Walla Walla
Registered: 2004-11-19
Posts: 2,215
Website

multiple categories/sections with [txp:article_custom/]

It would be useful if the article_custom tag’s section and category attributes accepted a comma separated list of sections/categories.

[edit] Oh, I see chh_article_custom does this… still, it’d be nice to incorporate some of this stuff into the core.

Last edited by mrdale (2007-02-14 22:02:18)

Offline

#2 2007-03-01 03:30:10

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

Re: multiple categories/sections with [txp:article_custom/]

seconded – coke’s plugins are great but unfortunately don’t look like they’re being updated to follow Txp development

Offline

#3 2007-03-03 01:08:35

Zanza
Plugin Author
Registered: 2005-08-18
Posts: 699
Website

Re: multiple categories/sections with [txp:article_custom/]

I second this too. It would be very important to not rely on plugins. Also needed for txp:related_articles tag!

Z

Offline

#4 2007-03-03 07:19:05

Pat64
Plugin Author
From: France
Registered: 2005-12-12
Posts: 1,615
GitHub Twitter

Re: multiple categories/sections with [txp:article_custom/]

Zanza wrote:

I second this too. It would be very important to not rely on plugins. Also needed for txp:related_articles tag!

I agree too.


Patrick.

Github | CodePen | Codier | Simplr theme | Wait Me: a maintenance theme | [\a mi.ni.ma]: a “Low Tech” simple Blog theme.

Offline

#5 2007-03-03 07:38:13

FireFusion
Member
Registered: 2005-05-10
Posts: 698

Re: multiple categories/sections with [txp:article_custom/]

Agreed

Offline

#6 2007-03-03 17:29:06

mrdale
Member
From: Walla Walla
Registered: 2004-11-19
Posts: 2,215
Website

Re: multiple categories/sections with [txp:article_custom/]

Well we all agree, does someone have the chops to put together a patch and submit it?

Sadly I’m no PHPer.

Offline

#7 2007-05-22 06:19:07

Jeff_K
Archived Plugin Author
From: Vancouver, British Columbia
Registered: 2005-08-19
Posts: 202
Website

Re: multiple categories/sections with [txp:article_custom/]

Hmm. Well I have been using chh_article_custom for a while, but tried to whip up a hack to see if I could avoid using the plugin. Try replacing line 600 of publish.php with:

if ($section) {
$sections = explode(',', $section);
for ($i=0; $i < count($sections); $i++) { 
$sections[$i] = "Section = '".doSlash($sections[$i])."'";
}
$section = 'and ('.implode(" OR ", $sections).')';
}
else $section  = '';

Limited testing seems to yield favorable results. I can submit it as a patch, although it could probably be simplified a bit..

Last edited by Jeff_K (2007-05-22 06:25:10)

Offline

Board footer

Powered by FluxBB