I've been trying to find a simple way to do this, and it's not easily found.
I want to create a View (either a block or page, I would have application for both) that can list taxonomy terms in a given vocabulary. Unfortunately, I can't figure out a good way to do this.
When I've tried, it's very inconsistant, and prints duplicates of the taxonomy terms (using node: distinct doesn't fix it)
Is there a way to do this?
The application I outlined here would be a good example: http://drupal.org/node/128080#comment-211402 (I didn't realize until after the post, that creating a list of galleries (which are actually taxonomy terms) would be the hard part)
I looked into the Category module (with category views) and it either doesn't do what I want, or I didn't understand it.
Any help/direction here?
Comments
Maybe I didn't get your
Maybe I didn't get your problem, but doesn't this work for you:
http://www.Yoursite.Com/?q=directory
It presents me with a nice A (12) B (44) C (17) ... Z (5) list, which, upon clicking, opens the taxonomy terms beginning with that particular letter. But as I said, I don't know if that was your problem...
Ludo
In a block
Hey Ludo...
Thanks, but no, that's not what I'm looking for. (maybe I confused you by saying I'd like it in a page too)...
But, i"d like the taxonomy terms (only from a certain vocabulary) to display in a listing...so I can use them in a block.
For example, on our podcast, each 'series' of episodes we do is a taxonomy...I want to do a block listing of all of our series, which means listing those taxonomies. Does anyone know how to do this?
-Bob Christenson
Owner/Designer, Mustardseed Media, Inc.
MustardseedMedia.com
Access Denied
I get "Access Denied" and I'm logged in as user/1.
Nancy W.
now running 5 sites on Drupal so far
Drupal Cookbook (for New Drupallers)
Adding Hidden Design or How To notes in Your Database
NancyDru
A little more clarification -
Do you want the block of taxonomy terms to be related to the node in which the block is displayed?
If not - it might be easier to not use views at all, and just create a block using something like taxonomy_get_tree() for each vocabulary using that vocabulary's vid.
This sounds good
If i understand this right, it might be the answer. I don't know PHP, so i'll have to play around with it, but I think all the info I need is on this page: http://api.drupal.org/api/HEAD/function/taxonomy_get_tree
Do i just format this into a block using PHP and it should list my terms for the vocab I designate?
-Bob Christenson
Owner/Designer, Mustardseed Media, Inc.
MustardseedMedia.com
Bob, To create a block with
Bob,
To create a block with php-generated content, go to Administer >> Site building >> Blocks and add a new block. Change the input format to php. I found the following in another post that may be helpful:
Once you've created the block, you'll have to enable it in a page region. You can also designate on which pages you'd like the block to appear.
Perfect
This looks perfect, jastraat. You're my hero.
But, is it just me, or is it strange that Views can't do this? Seems like it would be easy to implement. (Although, on second thought, views is good at listing nodes, but nothing else, sooo...maybe it's the wrong tool).
Anyway, thanks!
-Bob Christenson
Owner/Designer, Mustardseed Media, Inc.
MustardseedMedia.com
*grin
Glad to help.
Many thanks for this code
Nice and simple solution.
Quint
Works great!
I'm also adding a comment so I can track this solution.
Nice, but one problem I found...
Wow, this is what I was looking for. Thanks. However, the selection does not take into account articles, etc, that are unpublished. For instance, if I have only one story under a certain term, and it's set to unpublished, it still shows up in the list along with the count in parenthesis. Perhaps the SQL could be modified to exclude unpublished articles?
That is correct
There are cases where I want it this way, and there are cases where I'd prefer it the "standard" way. Try changing:
to:
This is untested, but should be real close.
Nancy W.
Drupal Cookbook (for New Drupallers)
Adding Hidden Design or How To notes in your database
NancyDru
Yep :)
Great! That seems to work. Thank you, Nancy!
BTW
You can find several variations on this code on my web site.
Nancy W.
Drupal Cookbook (for New Drupallers)
Adding Hidden Design or How To notes in your database
NancyDru
Your site is great
Thanks for your information and work.
BTW
I have now taken over the Taxonomy List module and some of those things are gradually working their way into the code.
Nancy W.
Drupal Cookbook (for New Drupallers)
Adding Hidden Design or How To notes in your database
NancyDru
Same problem
Hello,
I updated from 4.5.3 to 5.3 and i got the same problem, my categories block disappeared.
Your code fix it but would be posible to order it with the last updated term? And would be posible to show the last updated in days, hours, minutes ( examples: 1 years 11 weeks ago , 1 days 16 hours ago)?
Thanks.
Unfortunately, no
Taxonomy does not keep track of when terms are added. It could be added with a module, but apparently there are few people who want it.
Formatting intervals is easy: http://api.drupal.org/api/function/format_interval/5
Nancy W.
Drupal Cookbook (for New Drupallers)
Adding Hidden Design or How To notes in your database
NancyDru
Thanks!
Thanks!
Thank you.
I have spent an entire day trying to figure out how to acheive this - generate a block with the terms for the category selections for a section! Two seconds of work and your answer is implemented and working! I had tried everything, searched many places and was totally frustrated.
Only thing I had to do was to add the code for if the term was empty and luckly I had a person with php knowledge available...
Just adding the line:
if ($count)
above the line: $items[] = l($term->name, "taxonomy/term/$term->tid") . " ($count)";
and - PERFECT!
Thanks sooooo much for sharing...
<?php$vid = 1; // Set the
can you do this using the views UI?
lol
this discussion started with bob trying to use Views!
The upshot - Views produces a list of NODES not TERMS, so not really.
That said, here is a little "modulette" (just a packaged snippet) that uses a View to perform the queries - nodes are listed by term, using the View to select and format the node listing under each term.
http://lasqueti.ca/books/design-notes/custom-theme/directory
As a bonus, nodes for each term can optionally be put into collapsible fieldsets and organized into a number of columns to tidy up the display.
Here's an example of what this snippet can do:
http://lasqueti.ca/marketplace/directory
the View is defined to select only nodes that should be displayed in the directory (i.e., it filters out nodes I don't want displayed here) and specifies a Table view type with teaser image + title as link.
I am experimenting with
I am experimenting with this, but am getting an error:
Parse error: syntax error, unexpected T_VARIABLE in .../sites/mariagwyn.com.snqclean/themes/snq/template.php on line 390. This line is the line where I set the variable $vid. I have it set to the correct image vocab, and the directory_view.php file is uploaded, set with require_once ('directory_view.php');
Any ideas?
Thanks,
Maria
???
I, personally, can't.
If you want to get even fancier, rather than hard-coding "taxonomy/term/..." the more correct implementation would be:
This will allow modules like Taxonomy Redirect to function from your list.
Nancy W.
Drupal Cookbook (for New Drupallers)
Adding Hidden Design or How To notes in your database
NancyDru
Shouldn't this be...
$items[] = l($term->name, taxonomy_term_path($term)) . " ($count)";
failed
I tried this, and the import views method and neither returned my list. when i go to the /taxonomy/term/# page i see my nodes, but the query in the php code, and in the views approach seems to return nothing.
I like the php approach better because I am very new to the views module.
This way i just change the $vid to my term number and save the block. am i doing something wrong?
This has answered my
This has answered my prayers. I does EXACTLY what I needed. I am building a directory of items that are all catagorized, then sub-categorized, then sub-catagorized again where the nodes ONLY exist in the last category. I wanted to allow users to click through categories until they reach the nodes. (Similar to the old Yahoo.com if anyone remembers that far back)
Now.. I've figured out how to use this code and blocks to do it for each subcategories page... but that requires creating a block for each and every cat/subcat. Is there a way to make this work generic so that I only need to create one block and then assign that single block to all my cat/subcat pages.
I guess what I am looking for is something that would set the parent value automatically based on something rather than me making multiple blocks like :
taxonomy_get_tree($vid,1,-1,1);
taxonomy_get_tree($vid,2,-1,1);
taxonomy_get_tree($vid,3,-1,1);
taxonomy_get_tree($vid,4,-1,1);
etc.
Maybe
The Taxonomy Context module may do something like that; you can look at it for inspiration.
Nancy Dru (formerly Nancy W. until I got married to Drupal)
NancyDru
Vocab list filtered by content type
I found the same script in the book pages that jastraat kindly quoted, but there isn't an explanation of how to filter by content type. Has anyone come across this?
Some vocabularies can be used by more than one content type, and I want to just view the list for one of them - is this possible?
Thanks in advance for any help...
Yes
Depending on whether you want to change the code or not. One way is the Node Type Filter module. Also there was a similar request by "summit" I think that I helped him with and it's posted somewhere (possibly in this thread). Here it is: http://drupal.org/node/128085#comment-811814
NancyDru
Betsson Thank you...
Betsson
Thank you...
CasinoListesi.net
I didn't want the number in
I didn't want the number in parentheses after everything so I went with putting the following in a block:
This displays a simple list of parent terms as links for the vocabulary with vid = 1.
But how would I further modify this to list only parent terms that have more than 0 nodes attached to them?
I just want to know .... is
I just want to know .... is their any way by which i can skip certain taxonomy terms ?
or may be some way to skip the very first term....
Taxonomy Link Mover
I've just recently added a new module called Taxonomy Link Mover that might help you. My customer uses it to not show terms from one vocabulary, and the others in alphabetical order.
NancyDru
Thanks for your reply but
Thanks for your reply but taxonomy link mover was of no use to me ... :(
I am using this code
to generate a taxonomy list ... but i want to display ONLY CHILD ITEMS ... and the above mentioned code prints everything
Try
BTW, you do realize that your count will include unpublished nodes as well as published?
NancyDru
I was suprised to find that I
I was suprised to find that I couldn't use views to display a sub-terms list. Maybe I was doing something wrong.
ajastraat, thanks for sharing this.
Hey there. I'll try to give
Hey there. I'll try to give you a step-by-step guide for what you'd like to do.
Create a new view under administrator, site building, views.
In the basic information area, give it a name. You can also choose to limit the visibility to certain roles. Close the basic area.
Open the Page area. Select Provide page view. Edit the View Type to List. Make sure "use pager" is not checked. Enter the amount of items you want to list in the "nodes per page" area. If you don't want there to be a limit, put in 0. Close the page area.
Open the block area. Select Provide block. View Type, List. Give it a title and, once again, determine the number of items you want to list. Close the block area.
Open the filters area. Add a filter: Node: Published
Node Published equals: Yes
Add a second filter: Taxonomy terms for CATEGORY
Where "CATEGORY" is the category you would like to display.
Select the value you would like to be displayed.
Close the filter area.
Open the Sort Criteria area.
Add criteria "Node: Title" and choose ascending or descending.
Walla! You are done.
Not quite...
Hey Chris...
Unfortunately, this is what i've been trying to do for a long time. However, it creates multiple listings for the same taxonomy item...and adding "Node: distinct" doesn't cure that....
Don't suppose you know how to fix that?
-Bob Christenson
Owner/Designer, Mustardseed Media, Inc.
MustardseedMedia.com
Bob, Sorry, I have no idea
Bob,
Sorry, I have no idea why it'd do that. Strange!
The reason...
...that multiple listings of taxonomy terms are showing up is because the View is actually returning nodes and just showing the node's taxonomy. So if multiple nodes share the same taxonomy the terms will be duplicated.
Views only returns nodes, so you just want a list of category terms then you need to use a different solution, like some of the ones below.
- Mike McCaffrey
Filtering taxonomies
Hi,
I prefer another filter:
For some reasons I feel more comfortable with it.
--
Best regards,
(js).
I think this is included in
I think this is included in the views bonus pack (untested)
http://drupal.org/project/views_bonus
Would the taxonomy_dhtml
Would the taxonomy_dhtml module be of any use?
http://drupal.org/project/taxonomy_dhtml
Hi, I've done this with
Hi,
I've done this with views - here is an export of my view:
$view = new stdClass();
$view->name = 'categories';
$view->description = 'Browse Subject Headings';
$view->access = array (
);
$view->view_args_php = '';
$view->page = TRUE;
$view->page_title = 'Browse Subject Headings';
$view->page_header = 'You are browsing a listing of the Land Centre\'s primary subject headings. For a complete listing of categories and subcategories, click here.
';
$view->page_header_format = '3';
$view->page_footer = '';
$view->page_footer_format = '1';
$view->page_empty = '';
$view->page_empty_format = '1';
$view->page_type = 'list';
$view->url = 'view/categories';
$view->use_pager = TRUE;
$view->nodes_per_page = '30';
$view->menu = TRUE;
$view->menu_title = 'Subject Headings';
$view->menu_tab = TRUE;
$view->menu_tab_default = TRUE;
$view->menu_tab_weight = '-10';
$view->sort = array (
array (
'tablename' => 'term_data',
'field' => 'weight',
'sortorder' => 'ASC',
'options' => '',
),
array (
'tablename' => 'node',
'field' => 'title',
'sortorder' => 'ASC',
'options' => '',
),
array (
'tablename' => 'node',
'field' => 'created',
'sortorder' => 'DESC',
'options' => 'normal',
),
);
$view->argument = array (
array (
'type' => 'taxletter',
'argdefault' => '6',
'title' => '%1',
'options' => '',
'wildcard' => '',
'wildcard_substitution' => '',
),
);
$view->field = array (
array (
'tablename' => 'node',
'field' => 'title',
'label' => '',
'handler' => 'views_handler_field_nodelink',
'sortable' => '1',
'options' => 'link',
),
);
$view->filter = array (
array (
'tablename' => 'node',
'field' => 'status',
'operator' => '=',
'options' => '',
'value' => '1',
),
array (
'tablename' => 'node',
'field' => 'type',
'operator' => 'OR',
'options' => '',
'value' => array (
0 => 'resources',
),
),
array (
'tablename' => 'node',
'field' => 'status',
'operator' => '=',
'options' => '',
'value' => '1',
),
array (
'tablename' => 'term_node_3',
'field' => 'tid',
'operator' => 'OR',
'options' => '',
'value' => array (
0 => '706',
1 => '1148',
2 => '471',
3 => '664',
4 => '1046',
5 => '796',
6 => '10',
7 => '1136',
8 => '13',
9 => '355',
10 => '1119',
11 => '9',
12 => '497',
13 => '70',
14 => '14',
15 => '822',
16 => '823',
17 => '821',
18 => '880',
19 => '11',
20 => '466',
21 => '49',
22 => '184',
23 => '51',
24 => '1211',
25 => '676',
26 => '819',
27 => '40',
28 => '626',
29 => '814',
30 => '700',
31 => '989',
32 => '243',
33 => '450',
34 => '303',
35 => '1210',
36 => '324',
37 => '1098',
38 => '648',
39 => '36',
40 => '170',
41 => '174',
42 => '1050',
43 => '173',
44 => '755',
45 => '1044',
46 => '521',
47 => '1195',
48 => '488',
49 => '313',
50 => '1169',
51 => '1107',
52 => '342',
53 => '181',
54 => '333',
55 => '299',
56 => '12',
57 => '8',
58 => '1133',
59 => '448',
60 => '805',
61 => '695',
62 => '506',
),
),
);
$view->exposed_filter = array (
);
$view->requires = array(term_data, node, term_node_3);
$views[$view->name] = $view;
Import this as a new view, then you'll need to change a few fields in the "filters" section to make it work, since your taxonomy terms are certainly different than these here.
This site is still under development, but if you want to see how this is working go to http://landcentre.dreamhosters.com/?q=view/categories
Cheers -
Incredible
All that to do what jastraat did in just a few lines and no extra modules...
Nancy W.
now running 5 sites on Drupal so far
Drupal Cookbook (for New Drupallers)
Adding Hidden Design or How To notes in Your Database
NancyDru
Just Views Code
Actually, Nancy...if this works, it would be MUCH easier for me to use than jastraat's PHP code..this is just an export of his View...and for us non-coders, it's much easier to update/tweak.
Another wonderful thing about views...import/export. I love this module! Thanks for utilizing this feature.
-Bob Christenson
Owner/Designer, Mustardseed Media, Inc.
MustardseedMedia.com
I've been having the exact same problem
Whew...this node is a godsend...good thing I found it. I've been trying to create a professor rating system for a student-run website, and we've got each professor as a term within the category.
...kept running into your problem of having the duplicate terms.
I will try this and see if it works!
Views is definitely the way ..
Using views would always be better than hacking away .... and definitely more accessible to non-developers ..
Non-Developers
Exactly, I'm doing a demo. If I told them to add code somewhere, they'd turn green.
I need something like what lukathonic has put together: list of taxonomy terms only using views.
Views needs nodes
Unless it's changed very recently, Views cannot display anything that is not attached to nodes. So something like a taxonomy or user list is not possible. Earl says he will do it some day, but probably not today.
Nancy W.
Drupal Cookbook (for New Drupallers)
Adding Hidden Design or How To notes in your database
NancyDru
Shows Tax Terms in Use
As I understand what's happening, this method -- "Taxonomy: Term Name/Summary, unsorted/: %1" -- shows terms that are currently being used (i.e. attached to a node). That's fine for me.
The people adding content and assigning terms will see the whole list in a Select List (i.e. the old fashion way) when they create a node.
excellent!
Following this discussion
Landcentre
Looking at the site I suppose that it is possible to make a site's design look a bit like Craigslist? As least the classifieds section.
--
Billy | Major: Accounting | CityTech@CUNY | Student Block.
...
This was Michelle's "subscribe" comment. I'm no longer interested in this thread and tired of having to open it to get it out of my new items. I can't delete it since there's replies so I'm changing the name to nancyw since she's active in the thread.
NancyDru
Ditto
I'm also posting to keep track of this thread.
I'm tracking this thread
I'm tracking this thread too, I'm still looking for a solution for this issue.
http://www.geektips.net
Tag
I am also looking for a good solution to this. I was using Taxonomy_DHTML, but it's very slow when there are thousands of terms involved. Bookmarking for now..
Josh
This is the answer to get a taxonomy list!
So, the secret is choose an argument
"Taxonomy: Term Name" where the default is "Summary, sorted as view", and title is %1
Amazing!
--
Cheers,
Thong
Tip: http://drupal.org/forum-posting
Website: http://www.edoodle.co.nz
what does the 1% do exactly?
what does the 1% do exactly?
The %1 puts the taxonomy
The %1 puts the taxonomy term name into the title for the "subview" (the view once it's given an argument and is showing you nodes for a particular term, not sure if that's the right word for it).
In other words, when you click on a term in the main view, and see the nodes for that term, the title is also the term.
To get a different title, change the %1 to something else. Eg, on my site I'm putting "News from %1" because the terms are village names.
Excellent :) Is there a way
Excellent :)
Is there a way to get it to show terms for which no nodes exist yet?
yes
but you don't want to hear it
Nancy W.
Drupal Cookbook (for New Drupallers)
Adding Hidden Design or How To notes in your database
NancyDru
How?
I would love to hear how this is done. Did you have to hack Views to accomplish this? Please do share, I'm looking to do the same thing. I need a complete list of taxonomy, regardless of whether a node has been associated with that term yet.
Thank You,
Josh
I do it without Views
It's only a small snippet of php code. http://nanwich.info/taxonomy-term-count
Nancy W.
Drupal Cookbook (for New Drupallers)
Adding Hidden Design or How To notes in your database
NancyDru
Nice, this solved my issues,
Nice, this solved my issues, plus added a nice bit of information about how many nodes are tagged with each term! Great!
Wow
Was having a hard time getting a page with only on instance of each taxonomy term listed using views. This example worked like a charm and had the added bonus of displaying the number of nodes in that category, as well as having the second listing page of the individual node titles.
Nicely Done
But What to Edit?
Hey I'm not quite sure how to edit this script...here's what I did.
Basically I removed the references to term_node_3 because I was getting errors associated with that. It imported but my list looks like this:
# Interesting Links (1)
# Interesting Links (1)
# Interesting Links (1)
# Interesting Links (1)
# Interesting Links (1)
# Interesting Links (1)
# Interesting Links (1)
# Interesting Links (1)
# Interesting Links (1)
# Interesting Links (1)
Rather than
# Interesting Links (10)
Any ideas?
View
I was able to get this view to work by changing term_node_3 to term_node_2... in my case. The number represents the vid of the vocabulary you are trying to list. I also had to eliminate the filters and sorting stuff that was in there and then add back what I needed (ie: published = yes). Works well, but I think the php would work just as well and maybe easier since you can't just import this view and have it work out of the box.
It is good to know how to do this both way.
Thanks,
Shrop
Same problem
I am getting the same problem with this view. Here's my view (still contains a lot of the text and settings from the original example):
All it does is show my taxonomy terms that begin with A, and it repeats the taxonomy term for each time it is attached to a node. E.g.,:
- Aa (1)
- Aa (1)
- Aa (1)
- Aa (1)
- Aa (1)
- Aa (1)
- Aa (1)
- Aa (1)
- Aa (1)
- Aa (1)
- Aa (1)
- Ac (1)
- Ac (1)
- Ac (1)
- Ac (1)
- Af (1)
- Af (1)
Am I missing something?
I have a bad feeling that this isn't intended behavior for the view, so it could disappear in future Views module releases.
I fixed that ..
Try changing Arguments => default to "summary, unsorted" .. that did the trick for me .. I dunno how i figured that .. i was wondering how to fix it, and my hand just pulled down the selector and chose that option and *BAM* it worked ... paranormal drupal coding .. !creepy!.
Other fields in the view
Hi,
Really great thread... only thing is, when using "Summary, Unsorted" it seems to only spit out the taxonomy terms and not any other specified fields.
So for example I am using taxonomy images and I would like the relevant images to appear next to each taxonomy term listed with the number next to it.
I define Taxonomy image in the fields section but the view only outputs the text.
Anyone have any ideas?
It needs to be in a view and not a block as I am using Services to access the view info and feed it to flash.
Thanks in advance
http://greggcoppen.com
http://www.iaminawe.com
That's a nice example for us
That's a nice example for us poor hacks.
Thanks
Hmm...
Would Jastraat's code above be simpler?
Nancy W.
Drupal Cookbook (for New Drupallers)
Adding Hidden Design or How To notes in your database
NancyDru
Not indeed...
Hi Nancy, I have seen your appreciation for jastraat's code in this thread at multiple places. Indeed it's simple and elegant, I appreciate that too. I also happened to view your modified version of code, which I would have liked to include here for instant reference but would not do so 'coz you have the right to post that!
Now two points in this context
1) Your code follows more or less same logic, but jastraat's code includes another logic - which permits printing, only where there are non zero no. of terms in the vocabulary, which you have skipped. On similar lines you have also done the trick to include terms with non zero no of nodes. Would it not be best to combine both? I could have done that, but you might prefer to post it yourself.
2) While theses codes are elegant, perhaps quicker too - yet assuming views are cached, wont using the view be faster (just due to caching)
Thanks
I left out terms with no nodes because I find that very confusing, especially in larger vocabularies. It is very simple to change.
Views, cached or not requires considerably more code (read: CPU) to do what this code can do easier. Further, Views requires several more queries in order to do it (caching will only mask that to some extent). Simple code is going to be more scalable than complex code.
This code now also includes support for the Taxonomy Image module.
Nancy W.
Drupal Cookbook (for New Drupallers)
Adding Hidden Design or How To notes in your database
NancyDru
Refining this list by node type
Thanks Nancy for this. A great help so far. But then this provides a block ACROSS all no types. I want to create a block which will only be for "story" nodes. Is there any way to do that?
Thanks.
I am using this code:
-----------------------------
Subir Ghosh
www.subirghosh.in
Well, actually
Actually, this only counts the nodes for which the vocabulary is applicable. If the vocabulary is defined only for "story" type, then only "story" would be counted. However, if it's defined for "story" and "page" then it will count both.
I do have another method that separates the count by type on my site. http://nanwich.info/content_count_taxonomy_term
Nancy W.
Drupal Cookbook (for New Drupallers)
Adding Hidden Design or How To notes in your database
NancyDru
refining by node type
This is a modified version of Nancy's code (see link above) to output an item list instead of a table:
-------------------------------------------
Interactive Worlds and Immersive Obsessions
http://www.asifproductions.com
-------------------------------------------
Interactive Worlds and Immersive Obsessions
http://www.asifproductions.com
Hmm...
It appears that you are only interested in a single content type here, so you can simplify the code.
The "foreach ($type..." [BTW, note the space in keeping with Drupal standards] isn't needed at all. The only part of that loop you need is
$count = taxonomy_term_count_nodes($term->tid, typ);
and note the change to the second parameter.Also, if you have a rather large taxonomy, "taxonomy_term_count_nodes" is not the best performing function to use.
Nancy W.
Drupal Cookbook (for New Drupallers)
Adding Hidden Design or How To notes in your database
NancyDru
Hmm again...
I think you mean the
if($content_type == $typ)
statement isn't needed. (in other words, the$count = ...
line does not need to be held within a conditional.) If so, you're right. I just tested it. But theforeach ($type...
loop is actually needed."taxonomy_term_count_nodes" ;-) I just lifted that straight from your example!
-------------------------------------------
Interactive Worlds and Immersive Obsessions
http://www.asifproductions.com
-------------------------------------------
Interactive Worlds and Immersive Obsessions
http://www.asifproductions.com
Hmm...
Maybe I'm reading it wrong (which has been known to happen) but I think you only need "$count = taxonomy_term_count_nodes($term->tid, typ);"
"taxonomy_term_count_nodes" is something that everyone has. I was just warning you that there are more efficient versions of that available. For example, if you have my Site Documentation module, it uses a more streamlined version called "sitedoc_term_count_nodes" that can be called from external code. It just will be less resource-intensive.
Nancy W.
Drupal Cookbook (for New Drupallers)
Adding Hidden Design or How To notes in your database
NancyDru
Count but not showing node-title/body
Hi,
In almost all the posts I see the node count. Is it possible may be to show how to ouput the nodetitle and nodebody/teaser under the termnames instead of the count behind the termnames?
I would very much be helped with a efficient version of this code then!
Thanks in advance for your reply! ,
greetings,
Martijn
Do you mean
Something like http://nanwich.info/node/173?
Nancy W.
Drupal Cookbook (for New Drupallers)
Adding Hidden Design or How To notes in your database
NancyDru
Yes! precisely like that, I
Yes! precisely like that, I like the different theming also :)
I like to use it with return theme('item_list', $links); [=> because other code where this peace should be implemented is made with this] Is this possible please?
See: http://drupal.org/node/128085#comment-717939 for the function I want to expand with this code.
Thanks a lot in advance!
Greetings,
Martijn
Here you go...
Nancy W.
Drupal Cookbook (for New Drupallers)
Adding Hidden Design or How To notes in your database
NancyDru
Altered panels_taxonomy_child_terms_list
Hi Nancy,
This is what I made of it, and it is working with Panels_taxonomy!
Thanks a lot for your help with this! It is working.
EDIT: May be very strange question.
But should I use:
Instead of taxonomy_select_nodes?
Greetings,
Martijn
You could
You could, but you lose the theme_item_list that you said you wanted. Then you would also need to change the "children" building.
Nancy W.
Drupal Cookbook (for New Drupallers)
Adding Hidden Design or How To notes in your database
NancyDru
You could
You could, but you lose the theme_item_list that you said you wanted. Then you would also need to change the "children" building.
Nancy W.
Drupal Cookbook (for New Drupallers)
Adding Hidden Design or How To notes in your database
NancyDru
Hi Nancy, I leave it than. I
Hi Nancy, I leave it than. I don't know how to change this, and what the benefits and disadvantages are. It is working now, so I leave it this way, right?
Greetings, Martijn
Hi Nancy, Do you know how I
Hi Nancy, Do you know how I can get rid of the bullets? They look ugly on my site?
Thanks in advance for your reply!
Greetings, Martijn
CSS
Put something like this in your CSS:
And then make sure the <ul> gets a
class="no-bullets"
.Nancy W.
Drupal Cookbook (for New Drupallers)
Adding Hidden Design or How To notes in your database
NancyDru
Hi Nancy, This is my code.
Hi Nancy,
This is my code. It works fine, but shows the bullet and I would like only to show the nodes of the story content-type. Could you please look into this. What do I need to change in the code, so the no-bullet class will work, and what to get only the story nodes in the list?
Thanks a lot in advance!
greetings,
Martijn
easy
Change
return theme('item_list', $items);
to
return theme('item_list', $items, null, 'ul', array('class' => 'no-bullets'));
NancyDru
Hi Nancy,It is not
Hi Nancy,
It is not working on Internet Explorer.
I added this to my style.ccs in my garland theme:
But firefox only shows the item-list css and gives no-bullet as class inside item-list.
The backgrond image gives the bullets in garland, but on IE 6 the bullets are still there..
Please assist.
thanks in advance!
greetings,
Martijn
Refresh Garland
Remember that if you change the Garland style sheet, you need to force it to recreate the active styles by (for example) changing the color scheme.
Nancy W.
Drupal Cookbook (for New Drupallers)
Adding Hidden Design or How To notes in your database
NancyDru
Hi Nancy,I will try this!
Hi Nancy,
This is what I see in the code:
<div class="content"><div class="item-list"><ul class="no-bullets">
But the no-bullets class is not overruling the item-list class. Shouldn't it be a div class?
Do you also know how to select only the 'story' contenttype in above code?
Thanks for the tip!
greetings,
Martijn
Try this
ul.no_bullets li {
list-style-type: none;
background-image: none;
}
NancyDru
(thought balloon)
how narrow can these comments get?
-------------------------------------------
Interactive Worlds and Immersive Obsessions
http://www.asifproductions.com
Pretty narrrow
Nancy W.
NancyDru
I can't stop!
I can't stop!
-------------------------------------------
Interactive Worlds and Immersive Obsessions
http://www.asifproductions.com
Oh My!
Nancy W.
NancyDru
OUCH!
OUCH!
-------------------------------------------
Interactive Worlds and Immersive Obsessions
http://www.asifproductions.com
Shedding the pounds!
Shedding the pounds!
Skinny
Wish I could get this thin!
NancyDru
Jack Sprat could eat no fat!
Jack Sprat could eat no fat!
norrowest
i think so
A very long thread ever and
A very long thread ever and narrowest comment : D
love, light n laughter
Done in a block
I was able to put this together based on your Code Nancy. I'm sure its not the Drupal way 100% but I thought it might help out some others... if for no other use than picking at the parts. The part people probably wont like, is that I cobbled all this together in a block using the php filtered text.
Thanks for the post that go me started :)
THE CODE
The View page
Fatal error: Unsupported operand types common.inc on line 1445
In D6.x, Nancy's code will throw this annoying error caused by changes in the l() function.
Fatal error: Unsupported operand types in ......common.inc on line 1445
The problem is the list of arguments after the href argument (those NULLs and true). They now have to be in an array. For more on this stuff, check out the explanation at the bottom of this blog entry.
But in most cases, dropping those arguments altogether should probably work:
Thanks Nancy!
Firstly, thank you so much for your contributions to Drupal. I've used many of your taxonomy modules/code snippets in the past and for that I'm really grateful. thanks also to the many other contributions here.
I've found this sample code of yours (from years ago!) and have tweaked it to display the title first, image beneath and lastly term description at the bottom in a neat little box.
Personally, I can read but not write php, so i can usually find my way to a solution...but I've got a really stupid question!
How would i go about displaying this list without using theme item_list? Once it prints the theme item_list, the div classes I have added are preceded by class="item-list". I don't want to change the general item_list css as i use this elsewhere on the website. Basically I want to display the list horizontally, so outputting the list without theme item_list would allow me to use my own classes and display my neat little boxes for terms and term images.
I use a similar method with Taxonomy Context that doesn't use the item_list and I've spent a long time trying to merge them with no success (I know its probably obvious to you or any other php coders out there!).
Any suggestions are much appreciated. Thanks in advance.
Hi, showing what code you
Hi, showing what code you have now, would help a lot.
Greetings, Martijn
Of course!
Hi Martijn,
Thanks for the quick reply...much appreciated. I've been away for a few days otherwise I'd have got straight back to you.
Here's my code:
Thanks in advance for your time.
Didn't get the view to work ..
Hello and Thanks for that thread, dealing with my Problem!
1. I tried to import that view, changed the settings for the taxonomy terms but I only get a blank page ... Any hints?
2. Does that only work if I know all taxonomy terms? Sinze I use freetagging it would be nice to have a solution working, without knowing all terms. (could I set a wildcard for the term?
3. the php snipet, shown abouve, could that be changed to sort the output? I want the last added term to be the first in the list.
4. I would prefer not only to have the list of terms, linking to the summary page, I want to have a list showing the term and bello it all assigned nodes with title and teaser. Any ideas?
Ok so... I've managed to get
Ok so... I've managed to get the block that displays the terms I need, plus I've managed to get it to display on all nodes of the content type to which the vocabulary is associated using some php code from the drupal site, the question is, how do I get the block to be displayed on each taxonomy term list pages for that vocabulary. Otherwise navigation is floored by the fact the user has to click back to get to a different term list.
Any ideas?!
The section/site is this: http://www.thegraffitiproject.net/links
Thanks for any help that can be given!
Use Refine Taxonomy
Hi, Adam
I think these module does what u need exactly.
Refine by Taxonomy.
http://drupal.org/project/refine_by_taxo
Justin
-- eliminate web developers and designers !!
-Dries Buytaert, Drupalcon 2007 yahoo summit.
Problem with one word length terms
I use the argument: taxonomy: term name / summary,sorted ascending too, but I have a problem with it.
If the term is only one word I dont have my nice views but I have the basic node teaser list. The terms with more than one words displayed with my custom views. I use pathauto to have nice urls. I have no idea why doesnot work with one word lenght terms...
Interesting Thread
Bookmarking, I want to try this.
Subscribing
Will need this one day
Subscribing too
..
you can use views_fusion?
you can use views_fusion?
Just Traking
Very useful.
I gotta try this
I gotta try this
Well...
Take a look at Taxonomy List
A slightly different way can be achieved with the Site documentation module doing
http://www.examplesite.com/sitedoc/vocabulary/xxx
- it will include a count by content types.Nancy W.
Drupal Cookbook (for New Drupallers)
Adding Hidden Design or How To notes in your database
NancyDru
Taxonomy List Is Awesome!
Nancy, the Taxonomy List module is perfect for listing categories. I'm creating a photo gallery site using Angie Byron's article at lullabot.com, and so I already have a view created that lists photos for a given term with an argument of the term name. Since the path I'm using was photos/tags, all I had to do was modify _taxonomy_list_get_table() to use my path and to use the term name, and it works like a charm.
Quick question; is it possible to override that function in a separate module instead of having to hack yours? From what I understand, the function name is prefixed with an underscore because it is just an internal function available to the module, which means the answer to my question would be no. Correct?
...
I wish I could take credit for Taxonomy List, but it is not my module. Typically, functions that start with an underscore are not documented interfaces and may change without warning. However, I can point to quite a few places in Drupal where such functions are used by other modules.
You might create a feature request for that module to allow for what you want. Given the widespread use of Views, they might do it for you.
Nancy W.
Drupal Cookbook (for New Drupallers)
Adding Hidden Design or How To notes in your database
NancyDru
Subscribing and Sample View - Taxonomy Photo Gallery
All,
If you're looking to create a photo gallery that lets folks view photos tagged with specific features (e.g. location (here, there), time (day, night), subject (person, building)). I created this view to let the audience choose photos based on taxonomy terms (admittedly a fixed set of terms). Using the prior example terms, the view can show all day photos, or all day photos of a building, taken here.
The view below is what I came up with:
$view = new stdClass();
$view->name = 'PhotoGallery';
$view->description = 'Photo Gallery';
$view->access = array (
0 => '15',
1 => '14',
2 => '16',
3 => '13',
4 => '12',
5 => '7',
6 => '8',
7 => '9',
8 => '10',
9 => '3',
10 => '5',
11 => '4',
12 => '6',
13 => '11',
);
$view->view_args_php = '';
$view->page = TRUE;
$view->page_title = '';
$view->page_header = '';
$view->page_header_format = '1';
$view->page_footer = '';
$view->page_footer_format = '1';
$view->page_empty = '';
$view->page_empty_format = '1';
$view->page_type = 'bonus_grid';
$view->url = 'photogallery';
$view->use_pager = FALSE;
$view->nodes_per_page = '0';
$view->sort = array (
array (
'tablename' => 'node',
'field' => 'title',
'sortorder' => 'ASC',
'options' => '',
),
);
$view->argument = array (
);
$view->field = array (
array (
'tablename' => 'image',
'field' => 'nid',
'label' => '',
'handler' => 'image_views_handler_image_img_link',
'options' => 'thumbnail',
),
array (
'tablename' => 'term_node_1',
'field' => 'name',
'label' => '',
'options' => 'link',
),
array (
'tablename' => 'term_node_5',
'field' => 'name',
'label' => '',
'options' => 'link',
),
);
$view->filter = array (
array (
'tablename' => 'node',
'field' => 'status',
'operator' => '=',
'options' => '',
'value' => '1',
),
array (
'tablename' => 'node',
'field' => 'type',
'operator' => 'OR',
'options' => '',
'value' => array (
0 => 'image',
),
),
array (
'tablename' => 'term_node_2',
'field' => 'tid',
'operator' => 'OR',
'options' => '0',
'value' => array (
0 => '15',
1 => '49',
2 => '25',
3 => '13',
4 => '14',
),
),
array (
'tablename' => 'term_node_1',
'field' => 'tid',
'operator' => 'OR',
'options' => '2',
'value' => array (
0 => '1',
1 => '2',
2 => '3',
3 => '50',
4 => '61',
5 => '62',
6 => '63',
7 => '64',
8 => '65',
9 => '66',
10 => '67',
11 => '68',
12 => '69',
13 => '70',
14 => '71',
15 => '72',
16 => '4',
17 => '5',
18 => '73',
19 => '74',
20 => '75',
21 => '76',
22 => '77',
23 => '78',
24 => '79',
25 => '80',
26 => '81',
27 => '82',
28 => '83',
29 => '84',
30 => '85',
31 => '86',
32 => '87',
33 => '88',
34 => '89',
35 => '90',
36 => '91',
37 => '92',
38 => '93',
39 => '94',
40 => '95',
41 => '96',
42 => '97',
43 => '98',
44 => '225',
45 => '226',
46 => '227',
47 => '228',
48 => '229',
49 => '230',
50 => '231',
51 => '232',
52 => '6',
53 => '7',
54 => '8',
55 => '233',
56 => '234',
57 => '235',
58 => '236',
59 => '237',
60 => '238',
61 => '239',
62 => '240',
63 => '241',
64 => '99',
65 => '118',
66 => '119',
67 => '120',
68 => '121',
69 => '122',
70 => '123',
71 => '100',
72 => '124',
73 => '125',
74 => '126',
75 => '127',
76 => '128',
77 => '129',
78 => '130',
79 => '131',
80 => '132',
81 => '133',
82 => '101',
83 => '138',
84 => '139',
85 => '140',
86 => '141',
87 => '102',
88 => '142',
89 => '143',
90 => '144',
91 => '103',
92 => '145',
93 => '146',
94 => '147',
95 => '148',
96 => '149',
97 => '150',
98 => '151',
99 => '152',
100 => '153',
101 => '154',
102 => '104',
103 => '155',
104 => '156',
105 => '157',
106 => '158',
107 => '105',
108 => '159',
109 => '160',
110 => '161',
111 => '162',
112 => '163',
113 => '164',
114 => '165',
115 => '166',
116 => '167',
117 => '168',
118 => '169',
119 => '170',
120 => '106',
121 => '171',
122 => '172',
123 => '173',
124 => '174',
125 => '175',
126 => '107',
127 => '176',
128 => '177',
129 => '178',
130 => '179',
131 => '180',
132 => '181',
133 => '182',
134 => '183',
135 => '184',
136 => '185',
137 => '186',
138 => '187',
139 => '188',
140 => '189',
141 => '190',
142 => '191',
143 => '108',
144 => '192',
145 => '109',
146 => '193',
147 => '194',
148 => '195',
149 => '196',
150 => '197',
151 => '198',
152 => '110',
153 => '199',
154 => '200',
155 => '201',
156 => '111',
157 => '202',
158 => '203',
159 => '204',
160 => '112',
161 => '205',
162 => '206',
163 => '207',
164 => '208',
165 => '209',
166 => '210',
167 => '211',
168 => '212',
169 => '213',
170 => '214',
171 => '113',
172 => '215',
173 => '216',
174 => '217',
175 => '218',
176 => '114',
177 => '220',
178 => '115',
179 => '222',
180 => '116',
181 => '223',
182 => '117',
183 => '224',
184 => '9',
185 => '10',
186 => '11',
187 => '12',
),
),
array (
'tablename' => 'term_node_5',
'field' => 'tid',
'operator' => 'OR',
'options' => '1',
'value' => array (
0 => '58',
1 => '244',
2 => '243',
3 => '247',
4 => '245',
5 => '246',
6 => '59',
7 => '60',
),
),
);
$view->exposed_filter = array (
array (
'tablename' => 'term_node_1',
'field' => 'tid',
'label' => 'Store',
'optional' => '1',
'is_default' => '0',
'operator' => '1',
'single' => '1',
),
array (
'tablename' => 'term_node_2',
'field' => 'tid',
'label' => 'Program',
'optional' => '1',
'is_default' => '0',
'operator' => '1',
'single' => '1',
),
array (
'tablename' => 'term_node_5',
'field' => 'tid',
'label' => 'Project',
'optional' => '1',
'is_default' => '0',
'operator' => '1',
'single' => '1',
),
);
$view->requires = array(node, image, term_node_1, term_node_5, term_node_2);
$views[$view->name] = $view;
Thank you so much!
Thanks for the exported views! I was rather despaired ...
Now that I've found this post, I can go to bed :)
Have a good night!
anschinsan
Subscribing
-
Is there any way can
Is there any way can differentiate the root taxonomy from the child taxonomy in the list using the Views
Example:
Taxonomy Root1:
Taxonomy Child A under Root1
Taxonomy Child B under Root1
Taxonomy Child C under Root1
Taxonomy Root2:
Taxonomy Child A under Root2
Taxonomy Child B under Root2
Taxonomy Child C under Root2
Subscribing as well...
Subscribing as well...
Subscribing
very helpful
subscribing
-
Weird...
Drupal is a mature tool, views seems to be too...
I'm still amazed that we cannot have list of Taxonomy terms in a bloc... why is it so complex ?
Anyway... subscribing too
-Pol-
-Pol-
https://not-a-number.io/
I speak too quick...
Here is the code that you need to do what you want...
It list distinct categories and link to content who belong to that category ;) (taxonomy term)
Thanks for Drupal and that marvellous views module !
Import that views:
-Pol-
-Pol-
https://not-a-number.io/
Error
I get an error "Unable to get a view out of that." in trying to import that view
-----------------------------
Subir Ghosh
www.subirghosh.in
fix
Very interesting thread...
Bookmarking too, will try this...
Ciprian M.
Webdesign & Multimedia
Did one of you also solve
Did one of you also solve the problem, that the menu doesn't collaps when using taxonomy menu links or views that list taxonomy teasers?
Related forum post
I've created a related discussion on this issue here:
http://drupal.org/node/186471 : Views: How a (somewhat post-) newb thinks through the taxonomy view problem....
How can I list terms from another vocabulary?
I'm trying to use views for something related, but I need to list the terms of other vocabulary inside the nodes. I mean:
I have the vocabulary "Sections" [ Politics, Entertainment, Society, etc ]
I have a free-tagging vocabulary named "Tags" -every node has one "Section" and several "Tags"-
I need to list the most popular "Tags" in the Section "Politics" -and for every other Section-
I think I most get all the nodes in "Politics", take all the Tags in every node and list by popularity..
How can I do this?
Any help will be *greatly appreciated*
I'd suggest starting a new
I'd suggest starting a new thread for this one. Otherwise it will be buried at the bottom of a looooonnnngg discussion...
Prophecy come true
Yeah this discussion has gotten pretty long
yeah, the thread that goes
yeah, the thread that goes on and on and on.
Is there a way to unsubscribe from a thread?
This is exactly what I'm looking for
I would also greatly appreciate help. The summary view in arguments doesn't seem to allow this. If you select a term from one vocabulary then you can't get a summary of terms for another vocabulary.
I was kind of hoping this would work
/myview/[term1]/[vocab2]/[term2]
so the url /myview/[term1]/[vocab2] would display this but instead it displays an empty list.
Have you considered...
Taxonomy List
NancyDru
How to change this
How to change this code:
to generate Taxonomy list in 2 columns?
Interesting concept
While I do multiple terms in columns (using tables) in some of my modules, I've never tried this. It might be an interesting exercise.
If you want a list to come out like this:
I would think this could be done totally with CSS, although you'd probably want to use a wrapper ("<div>") to make sure you didn't change all item lists throughout the site. The key would be to use "position: relative."
If you want the list to come out like this:
This may be a bit more difficult. Perhaps the array_slice function might be useful.
Nancy W.
Drupal Cookbook (for New Drupallers)
Adding Hidden Design or How To notes in your database
NancyDru
Check out A List Apart:
Check out A List Apart: Multicolumned Lists for help with the css for two column lists.
EP
Thanq
that a useful link ....
-- Sree --
IRC Nick: sreeveturi
Take a look at...
This is set for 3 columns, but changes easily: http://nanwich.info/drupal_collection/taxonomy/vocabulary_term_count_col...
Is that what you want?
Nancy W.
Drupal Cookbook (for New Drupallers)
Adding Hidden Design or How To notes in your database
NancyDru
thanks
It's an old link, but still relevant and very helpful.. Thanks again.
ep, thanks for link, it's
ep, thanks for link, it's very interesting.
nancyw, yes, that's what I need. But I don't find how it was done on your site.
OK
I will expose the code, or you can send me you email address.
Nancy W.
Drupal Cookbook (for New Drupallers)
Adding Hidden Design or How To notes in your database
NancyDru
Hi Nancy, If I want to
Hi Nancy,
If I want to create a page for a Vocabulary that lists the terms and few articles from each term how can it be done. Saw you link, that lists the terms and a description of the term, but I want to list few articles for each term.
Thanks
Zafer
Hmm...
Now you're getting into Views territory. I don't know for sure if it can do this.
I'll take a look and see if I can cobble something together. Do you just want titles or also teasers? In what order?
I'm beginning to wonder if I should gather all these little snippets together to put into a module.
Nancy W.
Drupal Cookbook (for New Drupallers)
Adding Hidden Design or How To notes in your database
NancyDru
I'll take a look at the
I'll take a look at the views, whether it can do this. I want the teasers also to showup.
> I'm beginning to wonder if I should gather all these little snippets together to put into a module.
That would really be great.
Thanks
Zafer
Okay
Nancy W.
Drupal Cookbook (for New Drupallers)
Adding Hidden Design or How To notes in your database
NancyDru
Thanks Nancy.. that
Thanks Nancy.. that worked
Zafer
Hi Nancy, good snippet,
Hi Nancy, good snippet, thanks. But I want to display just last node for each term without changeing the 'feed_default_items': I'm creating an image gallery with imagecache, imagefield and views, so I use a vocabulary for image sets and i'd like to display term list with imagefield thumbs from last node for each term, is this possible? I've tried with Views modules, but i can't do that!
Thanks and sorry for my bad English :-D
How to?..
Some categories have subcategories. Function taxonomy_get_tree generate Taxonomy List with all categories and all subcategories. What to do to generate Taxonomy List only with categories?
And how to do to print count of all nodes from all subcategories of one category?
Depth
If I remember (without re-looking at the code), there is an option "depth" parameter; set it to 0 (or 1?).
Nancy W.
Drupal Cookbook (for New Drupallers)
Adding Hidden Design or How To notes in your database
NancyDru
Count
nancyw, thanks for vocabulary_term_count_columns.
With "depth = 0" there are no subcategories in Taxonomy List.
Try it this way
taxonomy_get_tree($tid, 0, -1, 1)
Nancy W.
Drupal Cookbook (for New Drupallers)
Adding Hidden Design or How To notes in your database
NancyDru
It works
But I used taxonomy_get_tree($vid, $parent = 0, $depth = 0, $max_depth = NULL).
But your line is shorter, so I'll use your variant.
Code should be
Hi Nancy,
the code should be like this: taxonomy_get_tree($tid, -1, 1), I have testet it in 5.x.
Dirk
I have so little hair left to pull out...
I have been trying to get the depth option on my Taxonomy filter to work and it seems like all I should have to put in the box is 1 or depth=1. Neither has worked. Is there something that I am missing? I didn't see anything in Taxonomy help for this.
The taxonomy is called functional areas and it has two levels. I have an exposed filter that I only want the first level to display as an option for people to select.
Please help before I look like Bill Murray in King Pin!
Nodes from subcategories
I would like it to show the terms only from specific subcategory:
Example:
I've got in my taxonomy:
Country
- City1
-- Suburb1
-- Suburb2
-- Suburb3
-- Suburb4
- City2
- City3
- City4
.
.
.
And I would like it to show the suburbs of City1 in the block.
I was trying to do something by changing the numbers in taxonomy_get_tree($tid, 0, -1, 1) and by modifying the code but couldn’t get it to work. (don't know much php)
Try to use
Try to use not taxonomy_get_tree($tid, 0, -1, 1), but taxonomy_get_tree($vid, 1, -1, 1)
If it will be City2, so taxonomy_get_tree($vid, 2, -1, 1).
Thanks for the quick reply
Thanks for the quick reply Kalian
But it seems to be like if I put anything else than 0 in the parent ($parent = 0), the block wont show anything.
I see the logic that placing 1 in the parent would mean that "City" is the parent but somehow it shows only blank. -1 doesn't work either.
I keep testing and I let you know if I get it to work, which is unlike because I've got no idea what I’m doing.
Its working now
So the term ID for my city wasn't "1", it was "36". Now its working like it should.
Hi to all! I'm working with
Hi to all!
I'm working with Drupal for roughly one week, and the last few days I'm trying to set up a "News" page. I have created a category called "News" with two taxonomy terms: "General news" and "Mysite News". Moreover I added a new content type called "news".
To cut a long story short, i created a page and a block with the views module for "News" and in general it works ok. The page and the block are displayed as a Teaser List with a 'more' link.
All of the above (and a lot more) were created thanks to this forum advices and instructions. The problem is that i can't find an answer to the following issues though i spend a lot of time searching and reading. Anyway here it is:
Same problem when i hit the "General News" link where the url is mysite/?q=taxonomy/term/2. Is there a way to display the url according to the category? p.ex. mysite/news/?q=generalnews for the taxonomy term and mysite/news/?q=generalnews/id=123 for the 'more' link.
Any help for any of these???(Note that i'm not very familiar to php coding)
Thanks in advance!
V.
Hi 1)I have the same problem
Hi
1)I have the same problem with the URL but I don't have a solution.
2)It is somewhere in the style.css (I found it once)
3)You should be able to hide the authoring information by unchecking this option under administration->sitebuilding->themes->Global settings->display post information on
views
Hello
With the help of drupal I am building a business directory.
I have a big problem with views. I have a vocabulary named Domain Names and a company node. when someone ads their company they have to choose a domain name. How can I make a view to show a list of all the domain names and when I click the domain it shows all the companies in there. I hope you understand.
Thank you
Some Help needed
Hi Nancy,
I found this post while I was trying to put a pager in the image_gallery module. The Problem is, that the image gallery makes a taxonomy list wich is endless. So I want to give it an admin from to choose how many galleries are shown in a list. But I´m not able to make the code working! But somehow it´s not working on the gallery_list.
Maybe you find my error....
This shows me an pager but only on the frist level. But this pager does not work on the taxonomy(gallery)_list
Please some Help
Dirk
Thanks jastraat for the PHP
Thanks jastraat for the PHP code :). This stuff is all pretty new to me (especially PHP and stuff), but it works flawlessly! And Drupal, well, it just rocks :P.
Subscribe...
+1
- Subscribing -
- Subscribing -
Same issue and more complexity using multilingual vocabularies/nodes (i18n).
--
Italy
Awesome! Subscribing.
Awesome! Subscribing.
subscribe
- bottmanbros.com
- bbros.us -
Who else is interested in Lunch?
i did it like this
Imma In
just starting a project which I think this discussion will prove rather useful..
I'm sure I'll have a question or two in the near future or so regarding a local/regional classifieds site I'm in the process of designing/building.
awesome thread!
just subscribing Aleph
just subscribing
Aleph Ozuas
http://www.ciberarte.com.br
http://www.dzo.com.br
Hi, This thread is very
Hi,
This thread is very interesting. Thanks for all the input. I have may be a very simple question.
How to use http://drupal.org/node/128085#comment-636635 to show in a block the child terms of the term which is shown through the url and show underneath the node-title and node-teaser?
I think I have to alter this http://drupal.org/node/128085#comment-636635 a little to get this done. Can anyone help with this?
My starting code is the following (from panels_taxonomy, to get the child code):
This shows in panels_taxonomy my child terms, but not the underneath nodes..and the module is not planned to do so in the near future as I read the documentation.
Thanks a lot in advance! Nancy do you know how to proceed?
greetings,
Martijn
Hi Martijn, I think the
Hi Martijn,
I think the below is the code ur are looking for. It has my css stuff too, you can strip it or modify it. Also it does not display the teaser but just titles. But getting it should be easy, I think $node->teaser should work. You can try it out.
-ZM
I got this from
I got this from drupalsnippet.com and it will list the term with sub terms, how do you make it so that the sub terms only show when you click on the main terms?
nice
This is cool, thanks...definatly a step in the right direction for me.
Now, and maybe I'm already going in the wrong direction, but I started my process with using taxonomy_dss, which is pretty cool, so maybe that might help you here...
you can see an example of what I am working on here:
http://dev.sellingconnection.com/node/49
Choose NC Greensboro, and it will take you to a sub-terms page...
My Question though, is how to make the above snipplet not display Terms which currently do not have any sub-terms or nodes...
bad link
I think anyway, tried like hell to find your link: drupalsnippet.com, it should be: drupalsnippets.com
:)
oops, I was too busy
oops, I was too busy thinking about the code. Should have just copied over the url. I forgot to mention that I wanted the sub sections as drilldown style, now leaving the parent terms.
Yours is getting somewhere. How was it set up? The only thing is that it doesn't give the nice title-in-url and is using the number. This can be done with Taxonomy menu (I think that was the module along with dhtml menu). It gives a nice dthml drilldown to sub sections. I just don't like the fact that it has /category/1/1 as url. I would prefer /category/1/title-name for seo reasons. I do like the drilldown method though since it's more user friendly than having to go back to a page to look at previous terms.
http://www.drupalsnippets.com/snippet/category/menus
I think you'll just need to try out each of them and see which might work better. I wish I knew how to combine them, but I can't code really.
no worries on the url :) the
no worries on the url :)
the title in url is something that will come when I install pathauto...usually one of the last things I install on a site, as I want to have all my meat and potatoes ready before I start pouring gravy on them :)
I don't recall having even looked at taxonomy menu, though I probably did (I've goofed around with just about every taxonomy module there is so far), but I'm using taxonomy DSS (http://drupal.org/project/taxonomy_dss)
this is a desired effect, as I will want someone to be able to click on a node's tags, and be taken to a listing of terms as opposed to a view of nodes. Still not sure if this is the best way just yet to have site visitors navigate, but it's what I've come up with so far.
So in a node, if you click on Electronics, you'll be taken to a list taxonomy list of Locations which are also tagged with Electronics, and vice-versa.
-t
I've just installed taxonomy
I've just installed taxonomy DSS and...is there suppose to be a menu for it under Site Configuration? I don't see any config page or anything referring to DSS...
Do you have basic step by step as to how to do this? I'm so lost...
If I recall
It works out of the box, no config necessary...
what it does, after installed, is when you click on a taxonomy term...say "NC Greensboro", creates a "view" of sorts, that shows all taxonomy terms which are assigned to nodes with the term "NC Greensboro", thereby creating a give me where this, and this...
So, clicking NC Greensboro (term/25), and then clicking on Electronics (term/59), will give you a view based on term/25,59, in other words, show me all nodes that have "NC Greensboro" and "Electronics"...
Right now my demo site is in a bit of a shambles, so I can't go and rebuild this from scratch at the moment to see what did and didn't work at the time :)
Taxonomy Redirect
Nancy W.
Drupal Cookbook (for New Drupallers)
Adding Hidden Design or How To notes in your database
NancyDru
sadly
taxonomy redirect only handles TERM, and not TERMID
I'm running into this with another site of mine too...where I'd like to redirect TERMID somewhere other than a default taxonomy_term view
*ugh* this is fun ain't it :)
Huh?
The taxonomy module does not provide "taxonomy/termid"
Nancy W.
Drupal Cookbook (for New Drupallers)
Adding Hidden Design or How To notes in your database
NancyDru
you're right
and when you're right, you're right :)
I do have views installed, sorry I did leave that part out, but generally such an integral part of my "base" install for Drupal, I kind of forgot...
I've changed the menu to use
I've changed the menu to use this and with trevorlee_nc's method of using Taxonomy DSS, I was able to use the following for a right sidebar menu, and the DSS creates the sub term menu in the page content area. Now if I can just theme it so that the sub term menu will be to the left of the content instead of above the content, then I think it will work pretty good as a directory:
Try this for efficiency
Right now, this build the entire taxonomy tree and then only looks at the top level. This is potentially wasteful of resources.
$terms = taxonomy_get_tree($vid, 0, -1, 0);
would limit the tree to only the top level and save those CPU resources for something useful.Nancy W.
Drupal Cookbook (for New Drupallers)
Adding Hidden Design or How To notes in your database
NancyDru
Thanks Nancy... Do you know
Thanks Nancy...
Do you know how to create a list of only subterms and shown only when you are on any of the subterms for the particular main term?
Not off the top of my head...
Not off the top of my head, but I wouldn't think it would be that hard to figure out. Why not look through the taxonomy module? BTW, if you do, "subterms" are called "children." I would probably start with taxonomy_get_children, which is specifically designed to get the children of any term.
Nancy W.
Drupal Cookbook (for New Drupallers)
Adding Hidden Design or How To notes in your database
NancyDru
ok, I found this code which
ok, I found this code which does the job, but the pain is having to create each main term as a block to show in that term. If you have a few main terms only, then it's not too bad.
Which code?
Also you might want to look at "Refine by Taxonomy."
Nancy W.
Drupal Cookbook (for New Drupallers)
Adding Hidden Design or How To notes in your database
NancyDru
This code, but I do need to
This code, but I do need to create a block for each term. If there are subterms (children) for those, then I don't know what would happen.
This code, but I do need to
This code, but I do need to create a block for each term. If there are subterms (children) for those, then I don't know what would happen.
refine by taxonomy didn't seem to work...
This is what i was looking
This is what i was looking for..thank you very very much
Jackie R
Making a collapsible directory
I read through all this and it was very helpful but I couldn't find an answer to this specific question. How can you make a collapsible directory (in a view or block) based on a particular vocab . In other words, how can you spit out:
Category1
Category2
Category3
Then, when you click on Category 1, it turns into:
Category1
--Sub-category1
--Sub-category2
Category2
Category3
(I tried the directory module, btw, and for various reasons, it didn't do what I needed).
Have a look here
I'm not sure if you're still looking but I saw a good resource referred to earlier in this thread that describes exactly what you're looking for: http://www.drupalsnippets.com/snippet/category/menus
(This was originally posted by giggler I think)
This was pretty easy to do with my taxonomy vocabulary.
NOTE: I am using the "category" module that came with drupal - not using any other stuff except for the Tagadellic module.
Here's my exported view - hopefully this should work for anyone - but I do have the views extras added in, just an FYI
This produces a list of all taxo terms in my "taxonomy" vocabulary, in a list view.
Just change the option to your needs (I had to exclude a few terms, remember too many terms and the view gives a join error, mysql can only join so many things together)
Hopefully this helps someone!
$view = new stdClass();
$view->name = 'all_taxonomy_terms';
$view->description = 'These are all the tags in the taxonomy vocabulary';
$view->access = array (
);
$view->view_args_php = '';
$view->page = TRUE;
$view->page_title = 'All Tags (Taxonomy Vocabulary)';
$view->page_header = '';
$view->page_header_format = '7';
$view->page_footer = '';
$view->page_footer_format = '7';
$view->page_empty = '';
$view->page_empty_format = '7';
$view->page_type = 'list';
$view->url = 'view/all_taxonomy';
$view->use_pager = FALSE;
$view->nodes_per_page = '0';
$view->sort = array (
);
$view->argument = array (
array (
'type' => 'taxletter',
'argdefault' => '4',
'title' => '%1',
'options' => '0',
'wildcard' => '',
'wildcard_substitution' => '',
),
);
$view->field = array (
array (
'tablename' => 'term_node_3',
'field' => 'name',
'label' => '',
'options' => 'link',
),
);
$view->filter = array (
array (
'tablename' => 'node',
'field' => 'status',
'operator' => '=',
'options' => '',
'value' => '1',
),
array (
'tablename' => 'term_node',
'field' => 'tid',
'operator' => 'NOR',
'options' => '',
'value' => array (
0 => '18',
),
),
array (
'tablename' => 'term_data',
'field' => 'vid',
'operator' => 'AND',
'options' => '',
'value' => array (
0 => '3',
),
),
);
$view->exposed_filter = array (
);
$view->requires = array(term_node_3, node, term_node, term_data);
$views[$view->name] = $view;
Nothing unreal exists.
It doesn't
There is no "category" module that comes with Drupal. It was an unfortunate decision (which is now corrected) to refer to the Taxonomy module with the menu title "Categories." There is a contributed module called "Categories," but it is NOT the same.
NancyDru
OOPS
Sorry, I am using the base install of Drupal - I had 5.1 for so long I forgot. I am just using the core taxonomy module and tagadellic. My bad!
Nothing unreal exists.
How to display all taxonomies and nodes in order?
Hi all!
I need some help here. How can I possible generate and display something like this:
Taxonomy 1
- Node Title 1
- Node Title 2
- Node Title 3
Taxonomy 2
- Node Title 4
- Node Title 5
- Node Title 6
and so forth... to print all the terms in that particular Vocabulary.
It is something similar to shopping directory / sitemap. In a way, I want to print all the Taxonomies together with its node Title in one full page. I've went thru a few examples at (http://drupal.org/node/47412), such as http://drupal.org/node/74715 , this only divides the taxonomy according to alphabets and does not list everything.
I hope someone can tell me how to achieve the above.
Thanks in advance!
yeeloon
Take a look
http://nanwich.info/node/173
Nancy W.
NancyDru
Thanks!
Hi Nancy,
Thanks for the help. I think I have got it from http://drupal.org/node/128085#comment-723936.
Cheers!
yeeloon
yeeloon...
I packaged together a little script that will produce this type of nodes-by-term summary for a Views view. It uses the view to format the nodes under each term, and can optionally put each top-level term into a fieldset to tidy-up the display.
But you must define a view first to filter the nodes and define their layout and then override the summary view in template.php to call this little function.
This works great in conjunction with the Taxonomy Redirect module.
See http://drupal.org/node/225426#comment-770201
Show all nodes belonging to top level parent
Ok.. similar to everyone else.. but yet different.
I have a large taxonomy setup like:
Site
-Cat1
oCat2
*Cat3
*Cat4
*Cat5
oCat6
oCat7
-Cat8
etc.
I want to be able to display a list of all nodes (titles only) that exist under each 2nd level category (and all of it's sub categories - 3rd level, 4th level).
So I want to be able to create a link at the bottom of say "Cat2" to say "show all articles in this category" which then creates a list like:
-Cat2
oCat3
*Node1 Title
*Node2 Title
*Node3 Title
oCat4
*Node1 Title
*Node2 Title
*Node3 Title
oCat5
*Node1 Title
*Node2 Title
*Node3 Title
And each title links to the full story.
Basically I want to create an index of all the content under the top level categories without forcing the user to drill down into the sub categories.
Take a look
Take a look at Taxonomy Browser and/or Taxonomy List and see if something would be easy to modify.
NancyDru (formerly Nancy W. until I got married to Drupal)
NancyDru
Fantastic!
This is a wonderfully informative thread! I am particularly thankful of jastraat's block and Nancy's tips. That block does exactly what I wanted it to!
If you're not big on views or php blocks, have a look at the Vocabulary Index module (http://drupal.org/project/vocabindex) I don't think I'll use it in production but it makes an easy index page for Category terms. Some more info on using it as a directory index page (feature request) here: http://drupal.org/node/225916
Thanks,
Andrew
excellent thread!
excellent thread!
About the Nancy code
How do we make this code work with translated taxonomy terms ?
I'm using i18n to change between English and other languages, but the output is always coming in English.
Which "Nancy" code?
In general all you need to do is to add a "db_rewrite_sql". If you point to which code, I'll do the change.
Nancy W.
Drupal Cookbook (for New Drupallers)
Adding Hidden Design or How To notes in your database
NancyDru
taxonomy list block
Hmm...
Interesting. Taxonomy_get_tree uses "db_rewrite_sql" so I would have thought it should be pulling in the terms with the currently set locale. I'm not sure what to do next. Perhaps a support request for the i18n module, including this snippet. If you do, please use my contact form to send me a link to it; I'd like to know.
Nancy W.
Drupal Cookbook (for New Drupallers)
Adding Hidden Design or How To notes in your database
NancyDru
Subscribing - especially
Subscribing - especially interested in future solutions for the issue with i18n.
Try 6.x
Drupal 6 has many improvements for internationalization. There will be no core improvements in 5.x, and probably none in 6.x unless they are shown to be serious bugs. Drupal 7 is open for code changes, so if you have suggestions in that area, you need to file an issue against core (http://drupal.org/project/issues/drupal).
Nancy W.
Drupal Cookbook (for New Drupallers)
Adding Hidden Design or How To notes in your database
NancyDru
hello
I opened an issue
#240910: i18n: translation not working for Taxonomy list
Children Taxonomy list
Children Taxonomy list filtered by story?
Hi Nancy and others!,
I am not getting the Children taxonomy list correctly filtered by nodetype "story".
Can you please assist?
The code I now have is:
But it is not working..:(
Thanks a lot for your answer in advance!
greetings,
Martijn
Complex?
I think you've made this more complex than it needs to be, but can you explain your goal?
Nancy W.
Drupal Cookbook (for New Drupallers)
Adding Hidden Design or How To notes in your database
NancyDru
Hi, Nancy helpt me to get
Hi,
Nancy helpt me to get this working.
Change:
to:
Greetings, Martijn
subscribing
very interesting thread
How to use the taxonomy block for a single content type
Hi Nancy-
I've been following your comments all over the place in my efforts to learn Drupal, and have come up against a problem I can't solve--probably because I am looking at this the wrong way. So here goes:
--I have two vocabularies, authors and topics.
--Each applies to both story and blog content.
--I want a block entitled "Stories By Topic'' which shows *only* the stories for a particular voc term
--I'll repeat this strategy for remaining voc/content type combinations.
Using something a lot like the jstraat code, I can get a voc block which returns content by topic ( term ), but it returns *both*types of content, not just one
If I use separate vocabularies for each content type, I can't figure out how to show the corrrect voc blocks for the content type and hide the other set.
Hope you and the other thread contributers can shed a little light. Thank you ever so much for your great thread, NN
Look above
Summit's problem was pretty much the same. After you load the node, you need to check its content type.
Nancy W.
Drupal Cookbook (for New Drupallers)
Adding Hidden Design or How To notes in your database
NancyDru
Subscribing
subscribing
subscribing
subscribing
http://SocialNicheGuru.com
Delivering inSITE(TM), we empower you to deliver the right product and the right message to the right NICHE at the right time across all product, marketing, and sales channels.
Subscribing
subscribing.
thanks again nancy for this
thanks again nancy for this tips
subscribing for sure!
www.salviadepot.com
On term view, get a block with the sister-terms of the same pare
Hi Nancy,
I would like to have a block with the sister terms of the taxonomy/term page which I see in term view mode.
What I would like is to have a block next to this with the sister terms, the node-titles and teasers underneath.
For example I have a trekking in Annapurna region in Nepal, the block needs to show first the (sister terms) other regions in nepal, the nodes titles and teasers underneath and not also the annapurna region nodes.
Thanks a lot for going into this in advance!
greetings,
Martijn
Hmm...
Well, you can start by getting the parent term (taxonomy_get_parent) then get the children of that term (probably depth=1) and unset the current term. Using that list, you can use taxonomy_select_nodes and taxonomy_render_nodes.
NancyDru (formerly Nancy W. until I got married to Drupal)
NancyDru
Hi Nancy,
Hi Nancy,
I think I need something like:
but than with parent - sister looking. Do you know the alteration of the code for that please?
Thanks a lot in advance!
greetings,
Martijn
Anyone has Parent looking
Anyone has Parent looking code, instead of children please?
Thanks in advance for sharing?
greetings,
Martijn
TinyTax module
FYI - there is also this module: http://drupal.org/project/tinytax
"Displays a vocabulary as a tree within a block. Provides blocks for each of the vocabularies on a site. Browsing the terms within a block is done via AJAX like calls, making it quick and a light load on the server."
.
--
( Evaluating the long-term route for Drupal 7.x via BackdropCMS at https://www.CMX.zone )
code you are looking for
I think the below is the code you are looking for. It has css stuff too, you can strip it or modify it. Also it does not display the teaser but just titles. But $node->teaser should work. You can try it out.
Also, if you want to edit php code out of drupal, you can add block and than just require_once "/folder_in_site_root/php_file_with_code".
---
>Play Online
Filter and sort on 2 taxonomy vocabularies?
Hi all, this is a related issue, hope it fits into this amazing, knowledge-building thread...
Are there anyone here who knows how to filter and sort on 2 taxonomy vocabularies?
From: http://drupal.org/node/302162
Is it possible to show a
Is it possible to show a list view of the terms instead of a list of teasers when a term is selected?
Yes
Taxonomy List
NancyDru (formerly Nancy W. until I got married to Drupal)
NancyDru
Thanks for the quick reply.
Thanks for the quick reply. What I want to achieve is, whenever I click on a term, all the nodes associated with that term are displayed as a list of links and not as a list of teasers. Can't find a way to do this with Taxonomy list. How can this be achieved?
Hmm...
Try Taxonomy Redirect with this code:
NancyDru (formerly Nancy W. until I got married to Drupal)
NancyDru
tagadelic
I think tagadelic would be useful for some people here
yes, even solve 95% of here
yes, even solve 95% of here mentioned problems... ;)
--
naslenas.com - personal Drupal blog experiment
If it worked... I'm reading
If it worked... I'm reading this page because it doesn't.
I got confused after you guys
I got confused after you guys started putting in PHP code.
I am trying to have Views create a page for me to list all the terms in a certain vocabulary. But I can't figure out how to do it. I am guessing based on reading through the comments using the Views module isn't the right choice.
I added a Vocabulary called "Classified", and underneath it, I added all the terms in a hierarchical fashion. For example: For Sale >> Electronics, Clothes, Books, etc. Jobs >> Accounting, Finance, etc. All I want to do is have all these terms listed on a page so users can see different categories, click on them, then see all the postings other users have made. I used the Views module to list all the terms but it won't work. I set it to create a page, and for the Fields, I put in Taxonomy All Terms...
I'm trying to do the same and
I'm trying to do the same and am amazed at how hard it is.
Taxonomy List
I think you'd be better off with Taxonomy List. But that is just my opinion.
NancyDru
Hi Nancy, I had checked out
Hi Nancy, I had checked out Taxonomy List and viewed your demo page. Hopefully, constructively, your demo page did not really show off Taxonomy List as the solution I was after. I think it was the jumble of images etc. I have since installed it and applied it to a taxonomy with no images. Indeed it appears to actually go a long way to meeting my needs. Thanks for the module.
I'm Still having problems with this
Did you figure out your answer yet? I'm still having problems with similar issue.
---------------------------------------------------------------
Tungsten Ring
PLease help with the most important drupal problem ever
HI----
Please Nancy drew I need you help! I have been downloading every taxonomy module I can find.
I have several aggregated news feeds which contain numerous taxonomy tags from several taxonomy vocabularies.
Now,
I have a Taxonomy category "Business"
And several nodes in that category.
CAT Business
Node A
Term1
Node B
Term 1
Term 2
Node C
Term 1
I am trying to create a sortable list which I can
1) Change the CAT Selection ---- IE Business / Health / Science (with the option of multiple categories or all even?)
1a) Chose the cat of the term you are interested in learning about
2) List the tax term with the total number of times it is listed in a node... for the above example it would be
Term 1 (3)
3) Sort the list from ascending to descending or vice versa
Term 1 (3)
Term 2 (1)
4)Allow a filter to be added which would limit the time period by node published date
5) allow you to set the number of terms to display with paging option.
[SITE INTRO][2] Why Re-Create an Open Learning Resource @ TheCenterOfTheNet (Mission Statement) Part 2
Oh
I don't think you are going to find one that does all that. I suspect you are going to need a combination of a few modules and a custom one.
NancyDru
I’ve been trying to create
I’ve been trying to create navigational structure similar to that of craigslist—utilizing the drill down approach. The closest module I’ve found to do something like this is the Directory module but it doesn’t isolate the terms. I’m curious, is this thread discussing something like what I’m describing?
Likewise!
I have been trying to do essentially the same thing. All I really want is a simple way to list a given set of taxonomy terms in a vocabulary…or, basically I want a way to list all of the terms that are children of a parent term. It seems like a really simple, straightforward function that ought not be such a pain, but for all of my digging around in both modules or code snippets, I cannot find a simple solution. It is baffling to me that it's so difficult to find a quick bit of PHP that accomplishes this which I can then drop into a template file. Can anybody help me out with this? The sooner the better. Thanks!
using views
I was looking for a way to list nodes associated with taxonomy, in the same way that they appear in a book hierarchy. My trouble was that the nodes themselves would not show up in the drill down tree structure as links with most of the taxonomy modules.
Anyhow, i thought this tutorial was great (below), and now by using views i have a pretty nifty listing, its not collapsible, i have the listing in a table, with an associated menu item, but it works ok for me.
Still need to learn more about it, but there are some sorting options with views that are pretty neat that I want to figure out. If anyone else is using views, how did you make it work?
http://realtech.burningbird.net/content-management/planet-drupal-entries...
Views does this so
Views does this so easily.
Just create a view of type ' Term' (the default is 'Node'). Then add 'Taxonomy Category' as as a filter, choose which Vocab to use. Add 'Term Name' as field. Finally make a display block and you are done.
To be more precise
For those who are still on Drupal 5, Views (1) does not do it well. Views2 in Drupal 6 does.
NancyDru
Display Parent Terms & Subterms?
Hi,
I'm not sure where to post this, but hope someone can help..
How can I display the below all the terms & subterms under the Catalog vocabulary with proper indentation? The order/weight is similar on how it is stored under the Catalog vocabulary. Actually this is similar to the Ubercart's Catalog block, but I need just a simpler one to place in on the block. The ubercart's code is very complex and don't know how to retrieve it.
Any help would be welcome. Thanks!
Catalog
Clothing (6)
- Dresses (3)
- Sweaters (1)
- Tops (1)
Bags (2)
- Backpacks (1)
- Hobos (1)
Example screenshot
- yeeloon
Taxonomy List
Check Taxonomy List.
NancyDru
Thank you NancyDru!
Finally thanks to your Taxonomy List module, I've been able to display the terms & subterms correctly. Awesome stuff!
Thank you NancyDru!
DO it with .............
DO it with Views using 'term' type - the Taxonomy list will be printed.
@n_nelson350 - if you know a
@n_nelson350 - if you know a way to list only the top level terms in a user defined vocabulary with Views please share here. I don't think it's possible.
Drupal Web Designers Surrey South East England www.lightflows.co.uk
Found Many Solutions:
I found many solutions for different ideas:
Simple list of taxonomy terms
Modules to look at:
Using Views:
A list of terms with nodes and teasers under each term, or more
Use Views to group:
Create a node view type with the "fields" for "node title", "node teaser", and "taxonomy term." In your basic Settings box, click on "Style" and select "list" or perhaps a "grid" (then save). Then, click on the "style" settings icon again next to "lists" or the "grid." There you can select a grouping field. If you have set up a taxonomy, select that vocabulary. Click update, and you should be all set.
Subscribing....useful thread
Thanks
Useful info
subscribing for the useful thread.
Term Node Count module
Add Taxonomy: Term Node Count to display number of nodes tagged with that term
Subscribing
This helped me out and has some neat little snippets. Thanks!
PLEASE HELP!
I have spent millenia searching for a way to implement my desired catalogue, which would be as follows.
(Block 1)
"Shop by Category" (vocabulary)
term 1 (node count in brackets)
term 2 "
term 3 "
etc.
(Block 2)
"Shop by Brand" (vocabulary)
term 1 (node count in brackets)
term 2 "
term 3 "
etc.
I thought I'd done it with views, until I added more than one product per term. This produced the duplicate problem mentioned somewhere above. Then I tried using the module "Taxonomy List", and the block it outputs. This didnt work for me either, as the fonts were undesirable, and I couldn't seem to get it to display node count belonging to each term. THEN I FOUND THIS THREAD! The php code provided by jastraat and modified by NancyDru seems perfect, however I cannot get it to show! when I put the code into a block, with php code as the selected imput format, the block doesn't appear. What could be wrong?
Well...
First, "...as the fonts were undesirable..." should be fixable by overriding the CSS. "...display node count..." is a setting.
When a block does not show, it is usually because it is not returning any data or the role/visibilty settings are not correct.
NancyDru
tacxonomy with view
how do i Using view to display taxonomy as search in a page or in a block ? please any body who can help me the step