Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#49 2006-04-29 00:09:18

mrfahrenheit
New Member
Registered: 2006-04-21
Posts: 8

Re: [plugin] [ORPHAN] cbs_category_list

*bump

Offline

#50 2006-06-01 13:13:31

sgoodwin
Member
From: Boston, MA
Registered: 2006-05-11
Posts: 13

Re: [plugin] [ORPHAN] cbs_category_list

Can anyone tell me whether there’s some way around the default sort order (alpha by title)? Thanks.

Offline

#51 2006-06-27 23:42:17

cbeyls
Archived Plugin Author
From: Brussels, Belgium
Registered: 2005-09-12
Posts: 136
Website

Re: [plugin] [ORPHAN] cbs_category_list

@ Pat64 :

If you want the counter to be included in the link, just change the $out line to this (not tested but I assume it works):

<pre>
<code> $out[] = tag(str_replace(‘& ‘,’& #38; ‘, $title).($count ? ‘ (‘.$count.’)’ : ‘’),‘a’,’ href=”’.pagelinkurl(array(‘c’=>$name, ‘s’=>$section)) .(($activeclass && ($s = $section) && ($c = $name)) ? ‘” class=”’.$activeclass.’”’ : ‘”’));
</code>
</pre>

Note: I cannot reproduce the exact code on this forum because of limitations of Textile (sorry Dean). Please make the following changes:
  • There is no space between <code>&</code> and <code>#38;</code> in the above <code>’& #38; ‘</code> (When I wrote it right, it displayed as <code>’& ‘</code>).
  • <code>($s = $section)</code> and <code>($c = $name)</code> actually have 3 following equals signs instead of 1 (When I put 2 following equals signs or more, my message was truncated).

Last edited by cbeyls (2006-06-27 23:42:41)


My plugins : cbs_live_search (improved) – cbs_category_list – cbs_navigation_menu – cbs_gravatar (updated) – cbs_article_index – cbs_maintenance_mode (new) – cbs_section_language (new)

Offline

#52 2006-06-27 23:52:11

cbeyls
Archived Plugin Author
From: Brussels, Belgium
Registered: 2005-09-12
Posts: 136
Website

Re: [plugin] [ORPHAN] cbs_category_list

@ The-Exit, martinship, marvix :

The PHP warning message you see there occurs when there is no article in the current section matching any category, so the result is an empty list. When the list is empty, the array was not initialized properly before being passed to the join method, resulting in this warning message. Hopefully, you will probably never need to display an empty list using this plugin…
Anyway I have fixed that in a new version, 0.6. Just try it out if you don’t believe me ;)

Last edited by cbeyls (2006-06-27 23:53:22)


My plugins : cbs_live_search (improved) – cbs_category_list – cbs_navigation_menu – cbs_gravatar (updated) – cbs_article_index – cbs_maintenance_mode (new) – cbs_section_language (new)

Offline

#53 2006-06-28 00:14:38

cbeyls
Archived Plugin Author
From: Brussels, Belgium
Registered: 2005-09-12
Posts: 136
Website

Re: [plugin] [ORPHAN] cbs_category_list

@ mrfarenheit

  1. To display the word “article” or “articles” next to the article count:
    There is a line of code ending like that:
    <pre><code>
    .($count ? ‘ (‘.$count.’)’ : ‘’);
    </code></pre>
    Replace this portion with that one instead:
    <pre><code>
    .($count ? ‘ (‘.$count.’ article’.($count > 1 ? ‘s)’ : ‘)’) : ‘’);
    </code></pre>
    And that’s all.
  2. It is not possible to display a list of all categories of a section, even the ones for which they are no articles found, because categories are not associated to sections in Textpattern. The goal of this plugin is to show only the categories that are actually used in a particular section, hiding the other ones, to overcome this Textpattern limitation. So, if you prefeir to display a list of all categories (of all sections) instead, just use the standard <code><txp:category_list /></code> tag.

Last edited by cbeyls (2006-06-28 00:16:40)


My plugins : cbs_live_search (improved) – cbs_category_list – cbs_navigation_menu – cbs_gravatar (updated) – cbs_article_index – cbs_maintenance_mode (new) – cbs_section_language (new)

Offline

#54 2006-06-29 17:18:43

dimfish
Member
Registered: 2006-06-01
Posts: 72

Re: [plugin] [ORPHAN] cbs_category_list

Hi – did you find a way to sort the category list how you like? I would like to but can’t seem to figure how….
Thanks.

Offline

#55 2006-06-29 17:50:29

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

Re: [plugin] [ORPHAN] cbs_category_list

@cbeyls Thanks a lot for your help. It’s very usefull. Thanks Christophe for your very good plugin.
Regards.


Patrick.

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

Offline

#56 2006-06-29 17:55:45

sgoodwin
Member
From: Boston, MA
Registered: 2006-05-11
Posts: 13

Re: [plugin] [ORPHAN] cbs_category_list

dimfish wrote:

Hi – did you find a way to sort the category list how you like? I would like to but can’t seem to figure how….
Thanks.

no, still haven’t found a way… cbeyls, could you help?

Offline

#57 2006-06-29 23:48:51

cbeyls
Archived Plugin Author
From: Brussels, Belgium
Registered: 2005-09-12
Posts: 136
Website

Re: [plugin] [ORPHAN] cbs_category_list

Just tell me how do you want to sort your categories and I could consider adding the option. By post count?


My plugins : cbs_live_search (improved) – cbs_category_list – cbs_navigation_menu – cbs_gravatar (updated) – cbs_article_index – cbs_maintenance_mode (new) – cbs_section_language (new)

Offline

#58 2006-06-30 08:43:15

dimfish
Member
Registered: 2006-06-01
Posts: 72

Re: [plugin] [ORPHAN] cbs_category_list

Thanks Christophe…. the problem is that I would like to just give them a custom order, nothing to do with no. of posts or date….

Offline

#59 2006-06-30 11:21:01

cbeyls
Archived Plugin Author
From: Brussels, Belgium
Registered: 2005-09-12
Posts: 136
Website

Re: [plugin] [ORPHAN] cbs_category_list

Then either you create your category list manually, or you add a custom numeric column to the txp_category table (example: “position”), you fill the values of this column with the positions want your categories to be displayed using phpMyAdmin and you update the SQL query of the plugin to change the “ORDER BY” clause so it orders the results by you custom column (example: “ORDER BY c.position”).

Last edited by cbeyls (2006-06-30 11:58:06)


My plugins : cbs_live_search (improved) – cbs_category_list – cbs_navigation_menu – cbs_gravatar (updated) – cbs_article_index – cbs_maintenance_mode (new) – cbs_section_language (new)

Offline

#60 2006-06-30 11:24:27

dimfish
Member
Registered: 2006-06-01
Posts: 72

Re: [plugin] [ORPHAN] cbs_category_list

Hey thanks Christophe. I am not too confident with going behind the scenes like that but I’ll give it a blast and let you know how it goes.
Thanks again.

Offline

Board footer

Powered by FluxBB