Two questions on [[ category-list ]]

Get help with installation and running PivotX 2.0.x here. Please do not post Extension or Theme related questions here.

Two questions on [[ category-list ]]

Postby Sanzine » Fri Nov 06, 2009 12:48 pm

I have two questions regarding the [[ category-list ]] tag.

1) Is there a way to show how many entries there are for a certain category? On my weblog I'm displaying the categories using the above tag and behind every category I would like to show the number of entries for that certain category.
E.g.
category 1 (10)
category 2 (6)
category 3 (0)


2) Is there a way to add an id to the category-list? On the tag [[ pagelist ]] you can add isactive="id='active'". Is this also possible for the category-list tag?

Thanks in advance for your help!
Sanzine
 
Posts: 55
Joined: Tue Jan 20, 2009 10:15 am

Re: Two questions on [[ category-list ]]

Postby hansfn » Fri Nov 06, 2009 2:33 pm

The count of entries per category isn't available yet. Good feature request.

There is already "%active%" that you can use for [[category_list]]. (I notice that it isn't listed in the PivotX book.)
hansfn
Developer
 
Posts: 3072
Joined: Sun Nov 25, 2007 7:48 pm
Location: Molde, Norway

Re: Two questions on [[ category-list ]]

Postby Sanzine » Fri Nov 06, 2009 3:10 pm

Thanks for the reply, hansfn. A pitty that the counting isn't available yet. But I'll be patient... ;-)

Should the coding look like this then: [[category_list format="<li %active%><a href='%url%'>%display%</a></li>" isactive="id='active'" ]] ?

If so, it doesn't seem to work. The source looks like this when using the above code: <li %active%><a href='/?c=category'>Category</a></li>.
So the isactive="id='active'" doesn't seem to be correct.

How should it read?
Sanzine
 
Posts: 55
Joined: Tue Jan 20, 2009 10:15 am

Re: Two questions on [[ category-list ]]

Postby hansfn » Fri Nov 06, 2009 3:34 pm

That is the correct syntax (and I just tested with your code - cut and paste). This should work in PivotX 2.0.0. (You aren't using an older beta version?)
hansfn
Developer
 
Posts: 3072
Joined: Sun Nov 25, 2007 7:48 pm
Location: Molde, Norway

Re: Two questions on [[ category-list ]]

Postby Sanzine » Mon Nov 09, 2009 9:18 am

I was indeed still using beta 12j. Upgrading did the trick.

Thanks for your help!
Sanzine
 
Posts: 55
Joined: Tue Jan 20, 2009 10:15 am

Re: Two questions on [[ category-list ]]

Postby Sanzine » Mon Nov 09, 2009 10:07 am

OK, it did do the trick, but not completely as I wanted. There is a difference in placing the id in [[ pagelist ]] and [[ category-list ]].

[[ pagelist ]]
code: [[ pagelist
chapterbegin="<ul id="navlist">"
pages="<li><a %active% href='%link%' title='%title%'>%subtitle%</a></li>"
chapterend="</ul>"
isactive="id='active'"
]]

outcome: <ul id="navlist"><li><a id='active' href='/?p=home' title='Home'>Home</a></li>


[[ category-list ]]
code: [[category_list
format="<li><a %active% href='%url%'>%display%</a></li>"
isactive="id='active'"
]]

outcome: <li id="active"><a href="http://bladiebla.nl/?c=category">Category</a></li>


At the Pages the id is for the link (<a>), but at the Categories it is placed at the <li>, which means that I can't format the active link as I would like and why I started this topic.

Any solution to this?
Sanzine
 
Posts: 55
Joined: Tue Jan 20, 2009 10:15 am

Re: Two questions on [[ category-list ]]

Postby hansfn » Mon Nov 09, 2009 10:44 am

I think you have made a mistake - check very carefully how you specify the format for category_list in the template that is being used ;-)
hansfn
Developer
 
Posts: 3072
Joined: Sun Nov 25, 2007 7:48 pm
Location: Molde, Norway

Re: Two questions on [[ category-list ]]

Postby Sanzine » Mon Nov 09, 2009 10:56 am

Oops... :oops: That happens when you have more than one _sub_sidebar template...

Thanks!
Sanzine
 
Posts: 55
Joined: Tue Jan 20, 2009 10:15 am

Re: Two questions on [[ category-list ]]

Postby Sanzine » Thu Jan 07, 2010 10:02 am

Another question on this subject...

On another website I used exactly the code (that worked on the first site) to show an active category:

[[category_list format="<li><a %active% href='%url%'>%display%</a></li>" ]]

When I click the category, this active one is not showing as being active. In the URL the category is definately showing (?c=test), but the code is:

<ul>
<li><a href='/test/?c=test'>Test 1</a></li>
<li><a href='/test/?c=test2'>Test 2</a></li>
<li><a href='/test/?c=test3'>Test 3</a></li>
</ul>

How is this possible?
Sanzine
 
Posts: 55
Joined: Tue Jan 20, 2009 10:15 am

Re: Two questions on [[ category-list ]]

Postby hansfn » Thu Jan 07, 2010 11:43 am

The two sites are running the same version of PivotX?
hansfn
Developer
 
Posts: 3072
Joined: Sun Nov 25, 2007 7:48 pm
Location: Molde, Norway

Next

Return to 2.x Support Forum

Who is online

Users browsing this forum: Google [Bot] and 2 guests

cron