By knowledg3 on
hi, i'm creating a classified site (similar to craigslist) and i need to configure a view so that when the user loads up the homepage. a list of individual tables display each taxonomy vocabulary name and list terms displayed in list format. so that if the user clicks the list term it takes them to a page displaying associated content. Could someone point me in the right direction? thanks
example would be [vocabulary:state]
1. Florida [link to display sub list[cities]]
[vocabulary:for sale]
1. cars+trucks [link to display cars+trucks classifieds]
Comments
This should be no problem,
This should be no problem, using views in combination with the Insert view module (for showing a views inside nodes).
A scetchy writeup on how I would do it (supposes your're using Views 2.x):
After installing the insert view module mentioned above, and enabled the filter which comes with it the input format you're using (Under Administer > Settings > Input formats, and clicking "configure" on the actual input format, and checking the "insert view" checkbox) you should be able to show the term listings using the following syntax:
[view:the_name_of_your_view==vid]
...where "vid" is the id of the vocabulary you want to show.
(You can figure out vocabulary id's on "Administer > Content > Taxonomy" and then watching the URL:s when hovering over "edit vocabulary" for the different vocabularies. The URL:s contain the vocabulary id, the vid.
Samuel
thanks
thanks that really helped allot. one more question if you don't mind?
So, are you saying with the
So, are you saying with the above I can create a structure like so:
Vocabulary: “Industry”
“Industry” has a list of terms on the right sidebar utilizing the taxonomy block module.
The terms can be “Automotive,” “Education,” “Electronics,” “Entertainment,” “Retail,” and so forth.
A hypothetical user is interested in reading user-created reviews about hotels.
He clicks on “Entertainment”
An entirely new page is displayed with all of “Entertainment’s” child terms like so:
Page Title: Entertainment
Terms: Concerts, Movies, Sporting Events, Vacations.
He clicks on “Vacations”
An entirely new page is displayed with all of “Vacations’” child terms like so:
Page Title: Vacations
Terms: Cruiselines, Hotels, Resorts.
He clicks on “Hotels”
An entirely new page is displayed with all of “hotels’” child terms like so:
Page Title: Hotels
Terms: Four Seasons, Hilton, Peninsula, Ritz-Carlton.
He clicks on “Ritz-Carlton”
An entirely new page is displayed with all “Ritz-Carlton’s” locations (actually, Ritz-Carlton’s child terms) like so:
Page Title: “Ritz-Carlton”
Terms: California, Illinois, Massachusetts, New York.
He clicks on “California”
An entirely new page is displayed with all of “California’s” child terms that are also associated with “Ritz-Carlton” like so:
Page Title: “Ritz-Carlton – California”
Terms: Dana Point, Half Moon Bay.
He clicks on “Dana Point”
All the nodes that are tagged with “Dana Point” from the “Hotels’” hierarchical line will now appear.
Node Title: “The Ritz-Calrton in Dana Point is the best.”
Details, details, details.
Node Title: “Awesome stay at the Ritz-Carlton in Dana Point.”
Details, details, details.
I’ve tried so many different things to get such a page structure but nothing yet. Everytime a user clicks on a parent term or a child term, the links return a page that doesn’t filter the contents by the their respective terms, in and of themselves. It returns a ton of teasers that are difficult for users to find what they actually want. For example, when a user clicks on the term “Hotels,” he will get an absorbitant amount of nodes that absolutely had to be tagged with “Hotels” because “Hotels” is the parent term. Rather, the lineage should be like the above page structure so he can see and get what he is actually seeking.
No with what he presented it will not work the way u want it to
Yes sorry the above view structure that he presented won't solve that particular problem it will only create a view of list terms for the top level and its child terms (because they all have the same vid).I have the same problem in sense that I only want to create a structured tree view with links, where it only shows links in order like such
1: First view shows top level terms (parents)
2. Second view shows child terms (child's)
3. 3rd view shows child terms (if present) or associated content (nodes)
if you have any luck with this type of "structured tree view", please let me know of your solutions. But currently the one posted above will only show a view of all vocabulary terms for that ID.
Fix: only present top-level terms in vocabulary + custom link
I know this topic is pretty old, but I just had to solve a similar problem, so here is what I did
If you need to only display the top-level terms of a given vocabulary, create a view such as suggested by Samuel, and then :
1) add a relationship to "Taxonomy: Parent term"
2) add a filter on "Taxonomy: Term ID", using relationship "Parent", with operator set to "Is empty (NULL)"
This will list only top-level terms for any given vocabulary.
If you need to display some particular view when a term is clicked (instead of the default "Link this field to its taxonomy term page"), you can setup a custom link for when a term is clicked:
1) add a field "Taxonomy: Term ID", hide it by checking "Exclude from display "
2) re-order your fields to make sure "Taxonomy: Term ID" is first (click arrows icon next to "Fields +")
3) configure your "Taxonomy: Term" field, check "Output this field as a link" and enter something such as "some/nice/url/[tid]" (make sure "Link this field to its taxonomy term page" is unchecked!)
This will turn term names into links pointing to 'some/nice/url/[tid]', where [tid] is the term-id. You can then setup another view at this url, which uses the provided term-id as an argument to load the term and display it however you like.
I need that too
azwildcat, I need a nav structure exactly like the one you describe. If you figure out how to do it I'd love to know.
I'm so tired of trying to do
I'm so tired of trying to do this, I'd pay someone who knows to do it.
WILL PAY $
Me too
venusrising
Do it with views
use this code with tid argument and provide default argument with some php code given below. make note of you $vid.
Views will only get you part way there
Problem is that the taxonomy module overrides views for individual term pages. So one needs to add code to template.php in addition to the view.
Make a view that has a filter equal to your desired vid, and add an argument for "Parent term". We'll name the view "parent_child_tax".
I embed the view 'parent_child_tax' within a node template file ('node-page.tpl.php') so i can wrap it accordingly and therefore not need to add page display for the view. Inside 'node-page.tpl.php' exists the following code:
Inside template.php add the following:
Note that this code only gives you the terms not associated nodes and only works on 2 levels of taxonomy. Probably easy to add another view for the nodes. You might want to also do your breadcrumbs better - in which case consider checking out taxonomy breadcrumbs module or when its ready the new custom breadcrumbs module that will support taxonomy.
Also you can manipulate the breadcrumb right inside the mytheme_taxonomy_term_page function above - just insert code like
For a none views-based solution that handles more than two levels and allows for collapsible categories see: http://drupal.org/node/623644
Ok
Been following this one, this seems like a real "goodie" any chance of a visual example (ie a working demo)? Just for the benifit of us old guys?
Well after implementing the 2
Well after implementing the 2 level taxonomy code directly above, i started over and opted for a unlimited level collapsible fieldset approach. I made a link to a demo page which you can find after the code on this page - > http://drupal.org/node/623644
I think such a navigation
I think such a navigation structure should be in the core. This structure I'm trying to implement is the same exact one used in craigslist-the drill down approach.
If i'm not wrong
I think this module does exactly what you need: http://drupal.org/project/vocabindex
List of Terms
Found this while trying to think through the simple problem.
Here's what I wanted: a list of links to vocab parents.
Why doesn't that work straight away? Because those "listing" pages don't exist in Drupal core. I bet you could create a View to handle that, but I wanted a simple block to list other terms along the side when on a taxonomy term page. So here's what I did...
This will give you a view that produces something like an internal (non-hierarchical) listing of vocabulary and their respective terms. Kind like this:
Vocab 1
Vocab 2
Etc...
How to get rid of duplicate terms
Hi joshmiller,
I just tried your suggestion. It leaves me with a list as you describe, but each term is listed multiple times.
Vocab 1
* Term 1
* Term 1
* Term 1
* Term 1
* Term 2
* Term 2
* Term 2
* Term 3
* Term 3
* Term 3
Vocab 2
* Term 1
* Term 2
* Term 2
* Term 2
* Term 2
* Term 3
I did not see a way in the view to limit it to a distinct set of terms. Any idea?
Thanks, Jelo
Solved! Display Taxonomy Vocabulary with their Taxonomy Terms
I have few weeks using drupal and I just found how to do that,
hope helps someone:
Content: Taxonomy Term
Format: HTML list,
Settings: Grouping field Nr. 1: Taxonomy Vocabulary Name
Check box: Force using fields
Show: rendered entity
Fields: Taxonomy term: Vocabulary (choose those you need)
Regards,
Alex
Drupal 7 table view
First thank you joshmiller.
With D7 when you first add new view you first get to choose the content. And
"content" is the default. Use the dropdown to select taxonomy instead. Then can pretty much follow
your outline for a block view. For a nice page view use the table as the FORMAT. Then use the setting link
for the format to set up the table to use vocabulary as the "Grouping field" . Then you get a separate table
for each vocabulary. Nice!
A little bit of string parcing
Hello Joshmiller,
Thanks for your suggestion. I also get each item repeated several times. I saw the workaround suggestion too late, but for me, simple string manipulation worked fine.
Thanks again,
Does anyone have this working with a hiarchichal taxonomy?
I have a similar situation but my taxonomy has a hierarchy:
parent 1
child 1
child 2
parent 2
child 3
child 4
I want the initial block display to be:
+ parent 1
+ parent 2
and clicking on the +parent 1 to display:
-parent 1
child 1
child 2
+parent 2
Can this be done with just views or should I use a combination of Menu Block and Taxonomy Menu ?
You should be able to do it
You should be able to do it with taxonomy_menu to create a block.
I wanted to do this as a page and have more control over it though, so I tried doing it with views. One way to accomplish the listing of terms of a vocab, sorted by parent and their children is to use views_php to add your custom sort criteria based on the parent term name and current term name.
If anyone knows of a better practise way to do this, please post. If others have a genuine need for this, pop me a pm and I'll try format the code in a better way and post it. Cheers.
Hi there
I also want to do something like this:
product1
-product1.1
-product1.2
-product1.3
product2
-product2.1
-product2.2
-product2.3
etc...
For that I need a grid block where I have to display only product1 and product2 and at the hover to the block I need to display the terms of the main product. To make me clear when I hover to the block product1 I should see product1.1, product1.2, product1.3(this have to be links that goes to the page of the products.)
I really don't know how to do this, anyone found a solution???