Drupal 7 taxonomy root terms view display - drupal-7

I currently have a taxonomy setup like so using Drupal 7:
-root1
--child1
--child2
-root2
--child3
--child4
Something like a country state/province hierarchy.
What I would like to do is create a view for the different terms based on the parent id. So if a user clicks on root1 you would see child1 and child2. Now I've currently have this setup using a page view and using a Configure contextual filter: Taxonomy term: Parent term.
Here's my problem, how do I display the root terms? Basically I want to pass nothing in and maybe somehow setup a default value so that root1 and root2 are displayed on the page.
Current settings:
WHEN THE FILTER VALUE IS IN THE URL OR A DEFAULT IS PROVIDED
Specify validation criteria
Validation: Taxonomy Term
Filter value type: Term name converted to Term ID
I've also tried setting it up as a Term ID only and setting a default value of 0 hoping this would grab any terms with the parent ID of 0 but nothing displays.

This problem in D6 could be resolved easily using Hierchical Select. But the HS module is not fully ported yet.
The issue page about the hs_views submodule:
http://drupal.org/node/1170192

Related

Drupal 7: How do I use views to display information from the current node?

I have a Drupal 7 question. I would like to display certain pieces of information from my current node using a view.
I can use views to display information from other nodes easily by setting filters and other sorting features. That's no problem. However, I want to display information from the node which is currently opened. So, for example, if I'm on a page (node: 117, title: news), I can display all the images from that page, plus captions, by creating a view.
The logic, I suppose, would be to create a view with a filter (or contextual filter) stating that the node has to equal the current node, but I don't know how to do that.
Does anyone have any advice? How do I instruct a view to display information from the node which is currently open?
Thanks!
Edit the view
Add Content: Nid in contextual filter
In contextual filter options
WHEN THE FILTER VALUE IS NOT AVAILABLE
Select "Provide default value"
Type: Content ID from URL
Now the default argument will be the nid of the current node.

Changing default "Taxonomy term" view to add a filter and change path in Drupal 7

I am trying to do a seemingly simple thing but unable to come up with anything.
I'll be specific here for what I want to achieve. I want to clone the existing Taxonomy term which has a path of /taxonomy/term/%. After cloning this view, I wanna make the following changes to it:-
Change the name to Document of Taxonomy Term
Add a filter to this view of a field called is_document. It's a checkbox which is when clicked shows that this node of my taxonomy term is a document.
Change path to /taxonomy/term/documents/%, which shows that I am opening all nodes of this term which are marked as document.
Now when I open my site, let's say with the URL www.mysite.com/organisation/company/documents, it doesn't pick the view. The URL www.mysite.com/organisation/company works as it picks the default Drupal View.
Any idea what I can do here?
I hope I was able to explain efficiently.
UPDATE
I used TVI, but it changes all the pages of my taxonomy terms. I don't wanna change my current scenario where normal taxonomy term pages are opened through /taxonomy/term/% (native Drupal view). I just wanna open all taxonomy terms with a document filter when /taxonomy/term/documents/% view is selected.
Thanks.
I suggest you to download and install Pathauto for URL aliases patterns.
In your Views, you set the path at: taxonomy/term/documents/%
In Pathauto settings, you to go "Patterns", then scroll to the taxonomy section where you can set a new URL pattern: [term:vocabulary]/[term:name]/documents
Then, go to Update tab and update all the paths for Taxonomy.
Enjoy your new Views.

Addressing the tab menu in view when using taxonomy

I use taxonomy terms to address my menus(these taxonomy terms show the structure of my site) so when I create a view I should use the taxonomy path (instead of alias) for the page setting (the only way that I can link the view to my taxonomy address path as far as I know :P ). whenever I see the page URL I can see the alias. now I'm trying to set up a page that has 2 tabs. I have set it up but the problem is when I click in the tab I see the taxonomy path instead of alias ? (for example taxonomy/term/6/digital instead of CCTV/digital However default menu tab still work correctly and show the alias CCTV)
Is there any way to show the alias instead of taxonomy term address ?
I assume that you have a view that is filtering your taxonomy terms. If you render the results as fields, each field can have it's formatter. If you need a custom form of the output, you can define your own formatter or generate one via GUI with help of: custom formatters.
In case that you render your output as rendered entity, you need to find the right template file and use the drupal_get_path_alias() function within it.
As last I would hint you a great module that also might help you: taxonomy menu

Drupal 7 - How to create a contextual filter based on an aliased url

CASE:
I've created a content type 'Attorney', and have set a url alias pattern for all attorneys to be 'attorneys/[node:title]'. I'd like to create a view that uses the aliased path to display the information about the attorney. This view should have a 'page' display.
EXAMPLE:
When a user visits 'http://mydomain.com/attorneys/aaron-silber' the view returns data for the Attorney with the name Aaron Silber.
BACKGROUND:
I've searched high and low for a solution to this but can't seem to find one that works for me. Typically I'm asked to create a page view with a url of 'attorneys/%' and add a contextual filter with 'Content: Nid', choosing to provide a default value (type: Raw value from URL, path component 2).
The resources on the web for this case are aweful at best. Lets try to fix it here once and for all.
Thanks!
Use a Views block instead with the visibility set to "Only the listed pages" and supply "attorneys/*" in the textarea. Set the block to display in the main content region. Use the Content: Nid filter with a default value of path component 2, as you were previously attempting.
You can't have an attorney node page and a Views page occupying the same URL.

Drupal 7 - How do I use pathauto taxonomy terms in views arguments

I have been banging my head against this problem all day. I'm using Drupal 7, and I'm trying to create a contextual filter that uses the pathauto string for a taxonomy term, not the taxonomy term ID.
So, I can make this work:
http://foobar.com/tags/1
But not:
http://foobar.com/tags/tagname
I have created a contextual filter of 'Content: has taxonomy term ID'. I have turned on the default taxonomy view and modified the path in it to try to create a URL that will work. I have gone into /admin/config/search/path/patterns and modified the taxonomy term path. As a result I can make the numeric ID appear in almost any URL with any prefacing text, but I can't get my view to use the pathauto-generated string for a taxonomy term instead of the taxonomy ID.
Any ideas? Am I missing something? All help is appreciated.
--Marshall
The default view "Taxonomy term," is using a contextual filter very similar to what you are trying to achieve, so possibly this could assist you in how to set something like this up. I would try creating a view of type taxonomy instead of content though.

Resources