Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Re: Articles by Category
for the “normal” displaying of articles by category, you can display it by section as long as the section doesn’t appear on the front page.
so domain.com/?c=food is different from domain.com/stuff/?c=food
I’ve put <txp:dca_articles_by_category /> on it’s own page, in it’s own section (like a category/site map) and now that I look at it, it only displays articles from sections that appear on the front page. and if I put it in a section that doesn’t appear on the front page, then it still only outputs a categorized list of articles that do appear on the front page.
Offline
Re: Articles by Category
I’m doing the same thing- I put the plugin tag on a page that is the only page in its section: “Contents,” in this case. But the result is just a list of categories with no articles.
Stumped.
Offline
Re: Articles by Category
try hitting refresh a couple of times.
do the other sections appear on the front page?
Offline
Re: Articles by Category
Yep- every article is in a section called “Articles,” which appears on the front page.
Here’s the page in question- right now I have an article_custom list that spews the articles in reverse chronological order under my malfunctioning dca_articles_by_category tag.
Thanks for all your help, Jason!
UPDATE: I’ve stopped trying to fix the problem for now, and my site features a separate list for each category. I’ll try again once TextDrive rolls out.
Last edited by Matt (2004-05-27 01:47:36)
Offline
Re: Articles by Category
I love this plugin. I love it so much, I’m renoodling it to make it a category_tree plugin, which I need for the site I’m developing. I’ll post it to the forum if I can generalize it enough to make it useful for others.
In my noodling, I noticed a small bug. The deeper your tree goes, the more <code><ul></code>s and <code><li></code>s remain left open. There’s one simple line that you can add to the function that cleans it all up:
<code>$out .= str_repeat(‘</ul></li>’,$lastlevel-1);</code>
It goes immediately before the this line near the end:
<code>return tag($out,‘ul’);</code>
I think I tested this out enough to show that it works all situations. But if it breaks on your site, please let me know.
Loving TXP, by the way. Keep up the stupendous work, Dean. Please.
Offline
Re: Articles by Category
Said category_tree plugin posted here
Offline
Re: Articles by Category
Could Dean or someone post how to edit this plugin so it prints the new “URL-only title” links – and not the older article title method?
Meaning, I want to print a list of articles by category with the article “title” as the link text, but the “URL-only title” as the actual URL link.
Thanks -
“If you build it, they will come.”
Offline
#23 2004-07-01 06:02:01
- pynchon
- New Member
- Registered: 2004-06-14
- Posts: 3
Re: Articles by Category
Matt, or anyone else,
How did you get it to finally work, that is show more than the category titles.
Currently, I’ve installed this plugin and have it on a page but it’s only showing a bulleted list of the categories with no article titles under them.
I’ve tried reloading the browser many times, but no go.
Offline
Re: Articles by Category
Pynchon-
I switched from my old host to TextDrive and now it works fine. I’m afraid it might have been a server configuration problem. Is your textpattern install in a subdirectory of your server’s root folder?
Offline
#25 2004-07-01 16:18:53
- pynchon
- New Member
- Registered: 2004-06-14
- Posts: 3
Re: Articles by Category
Matt, thanks for your quick reply! No, I don’t have my install in a subdirectory.
Had my server support working on this. They were helpful enough to try a test fresh install on their own and still couldn’t get it to work. Oh well, this sounded like just the thing I needed. But I guess I’ll have to wait for something else.
Offline
Re: Articles by Category
> bluearc21 wrote:
> Could Dean or someone post how to edit this plugin so it prints the new “URL-only title” links – and not the older article title method?
Dean – Anyway to update this plugin?
“If you build it, they will come.”
Offline
Re: Articles by Category
Okay, the following two changes to the Articles by Category plugin offered by Dean will print your content map with links to the new “url-only title” available in the advanced menu of article publishing.
1st change:
Original Plugin Query:
<code>
$rs = getRows(“select ID, Title, Section from textpattern […]
</code>
Plugin Query Mod:
<code>
$rs = getRows(“select ID, Title, url_title, Section from textpattern […]
</code>
2nd change:
Original Plugin code:
<code>
if (trim($Title)) {
$url = ($url_mode)
? tag($Title,‘a’,’ href=”’.$pfr.$Section.
‘/’.$ID.’/’.stripSpace($Title).’”’)
: tag($Title,‘a’,’ href=”’.$pfr.
‘index.php?id=’.$ID.’”’);
$thislist[] = tag($url,‘li’);
}
</code>
Mod Plugin code:
<code>
if (!($url_title)) {
trim($Title);
$url = ($url_mode)
? tag($Title,‘a’,’ href=”’.$pfr.$Section.
‘/’.$ID.’/’.stripSpace($Title).’”’)
: tag($Title,‘a’,’ href=”’.$pfr.
‘index.php?id=’.$ID.’”’);
$thislist[] = tag($url,‘li’);
}else {
trim($Title);
$url = ($url_mode)
? tag($Title,‘a’,’ href=”’.$pfr.$Section.
‘/’.$ID.’/’.$url_title.’”’)
: tag($Title,‘a’,’ href=”’.$pfr.
‘index.php?id=’.$ID.’”’);
$thislist[] = tag($url,‘li’);
}
</code>
“If you build it, they will come.”
Offline
Re: Articles by Category
I have the same problem as pychon I installed textpattern in a subdirectory though.
Offline
Re: Articles by Category
> Macindy wrote:
> Can somebody help me with a modification:
I don’t want that the plugin produces a list of ul and li tags. Simple puts the categorys in h5 tags and the article title in p tags.
It’s a list of things… why not use the list HTML tag then ? It has absolutely no disadvantages, and it’s developper’s friendly (aka semanticaly correct).
Offline