By freelylw on
Hi
I saw so many drupal site , They can display the count numbers of the term(how many post within this tem) ;
example : term1(38) term2(46) term3(53) ....
How can I display the count of the post within the term ???
Thank you
Comments
I just posted something
I just posted something about that here:
http://drupal.org/node/199380
if you read the post, you can see that i'm trying to restyle it but the code itself works.
here it is:
hello Thank you for your
hello
Thank you for your post.
Sorry for I am not a programer, I don't know where I should put these codes on ??? Can you please explain a bit more for where I can use this code ??
Thank you very much!!!
make a new block and post
make a new block and post the code into it
To make a new block:
so, goto "administer"
then click on "block"
then "add block"
In "block body" copy and paste this into it:
Click on "input format"
then make sure "php code " is selected.
Save the block
You'll have to select the area you want the block to be displayed in (usually right or left)
choose one and click "save blocks"
should work
Just remember to Set the vid to the vocabulary id of the vocabulary you wish to list the terms from.
The code i posted is using vid "2", you might need to change that to what ever number you want displayed.
thanks
thank you for this post - it did the trick.
using terms in a block for a new site - of course terms are near empty, but wanted to show the projected direction of site.
now, I won't be upsetting people sending them to blank areas
thanks again
Hello THANKS for your reply.
Hello
THANKS for your reply. Can I ask the vocabulary id is the name of the vocabulary ? am I right ? I putted the name of the vocabulary there to replace the '2' , but there is nothing showing on my page. Can you explain a bit more ?
Thank you so much
not sure
I'm not real sure what you are asking, but.....
If you are trying to discover the Vocab ID #.
Go to where you would edit the Vocab and click edit.
then look up in the URL box - you will see the Vocab #
hope that helps
Display Count in a Vocab/Term Menu
Nice, this works. But can any one take this to the next level and... integrate this into the Menu module if one chooses to display vocabulary as the options and its terms as its children (drop down items)?
I think this "count display" option should be native to Drupal or be available in a module!
I'm more of a designer and not a code junkie, so I'm afraid I can't help much.
How would I use this (ie get
How would I use this (ie get a list of all terms and the counts) if I only wanted to show those terms associated with a user's blog items?
eg url is ?q=blog/7