Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
djw_section_articles
djw_section_articles v0.6.3
Lists articles out of a given section.
Created by David Woodward. As David is no longer actively developing and supporting his plugin, we both have agreed that I would host and maintain it.
Last edited by wet (2005-11-19 20:23:48)
Offline
Re: djw_section_articles
Can’t we do that with txp:article_custom
?
Offline
Re: djw_section_articles
I suppose djw_section_articles could be imitated with a combination of
<h2><txp:section name="foo" link="1" title="1" /></h2>
<ul><txp:article_custom section="foo" category="bar" link="1" form="permlink" /></ul>
permlink
being a form like
<li><txp:permlink><txp:title /></txp:permlink></li>
One minor difference: djw_section_article does not output the section title and link when a section contains no articles. It’s mainly a matter of preferences: one line plugin tag versus some more lines of core tags. It will neither increase nor reduce db calls, I suppose, so page rendering time and cpu load will not differ a lot.
Offline
Re: djw_section_articles
Ok I missed the label included in the plugin output… can be nice, thanks Wet.
Offline
#5 2005-11-18 06:34:04
- rbl
- Member
- From: Portugal
- Registered: 2004-02-25
- Posts: 40
Re: djw_section_articles
Wet, is it possible to tweak this to exclude the current article from the list?
Offline
Re: djw_section_articles
Done. Setting current="0"
will suppress the link to the current article.
Last edited by wet (2005-11-19 20:22:27)
Offline
#7 2005-11-24 18:41:54
- rbl
- Member
- From: Portugal
- Registered: 2004-02-25
- Posts: 40
Re: djw_section_articles
Wet, is there any way to make djw_section_articles care for nck_olm or sgb_url_handler?
In a couple of my sections I use a different url mode and need to change the way djw_section_articles builds urls.
Offline
Re: djw_section_articles
Sorry, it will not. djw_section_articles is currently using txp’s core functions for building article links. I’d rather keep it that way to avoid introducing cross dependencies besides the ones introduced by txp’s own evolution.
Offline
#9 2005-11-24 18:51:24
- rbl
- Member
- From: Portugal
- Registered: 2004-02-25
- Posts: 40
Re: djw_section_articles
Ok, I can understand that but is there any way to hack it (even if it is an ugly one) to change the way the url is built?
Offline
Re: djw_section_articles
There is, of course.
Find this line in the current version of the plug-in code:
$out[] = tag($Title,'a',' href="'.permlinkurl_id($thisid).'"');
and replace the call to permlinkurl_id($thisid)
to anything which inserts the desired URL. $thisid
contains the article’s numeric id. Voilà.
Last edited by wet (2005-11-24 18:59:32)
Offline
#11 2005-11-24 20:28:30
- rbl
- Member
- From: Portugal
- Registered: 2004-02-25
- Posts: 40
Re: djw_section_articles
Thanks! I wasn’t getting there!
I added an if clause to output a different url if the section matched the different url mode one.
Thanks again!
Offline
#12 2005-12-20 19:28:42
- rbl
- Member
- From: Portugal
- Registered: 2004-02-25
- Posts: 40
Re: djw_section_articles
Here’s something weird. I’m using the plugin (v 0.6.3) 5 times in a page. One calls the current section article list and in the other 4 I use the section=“xxxx” to display the articles from other sections.
But it’s not working. It lists the current section articles always ignoring the section value completely.
I’ve tried changing “section” to “sec” and even “s” but it doesn’t change a thing. Another annoying thing is that it adds the section on top of the list even if you specified you don’t want it.
Offline