Drupal 7 taxonomy term nodes sort by WEIGHT - drupal

I've created content type called 'price' and defined field called 'weight'. Also I've created field 'Taxonomy term reference'. When clicking on Taxonomy term it shows all nodes related to this term. But How I can sort them by WEIGHT field?
At this moment I've created pages for all terms in views(I was lucky, I've got only 8 terms). But if terms would be more than 8. How can I automate this process? I would like create only one views for all terms.

Define Views for field reference -> node listing -> add relation for taxonomy term -> add sorting for this relation.

Related

View: Exclude nodes that have the same taxonomy term id(s) as current node

Drupal 8
I have a content type with a field that holds a Taxonomy Term Reference. I want a View that shows other nodes of the same content type that do not have that field with the same Taxonomy Term ID as the currently viewed node.
Example:
URL: /story/storyA
Currently viewing a node of Content Type Story that has a Taxonomy Term Reference to value B. I need the view to show other stories that do not have that same Taxonomy Term Reference to value B.
I thought I could achieve that by
Set up a relationship to the field that holds the Taxonomy Term
Add a Filter Criteria of Term ID associated to above relationship and with operator is not equal to. PROBLEM: how do I get the token for Value?
I also tried to go about adding a Contextual Filter associated to the created relationship and selecting Exlude but no dice.
I finally figured it out, I was missing the adequate additional Contextual Filter:
Term ID , Provide default value with Taxonomy term ID from URL and the options Load default filter from node page and limit terms by vocab checked. And the last bit, in More, I have Exclude checked. This contextual filter is associated to the created relationship mentioned in the question.

Drupal 8 equivalent of taxonomy term converted to term id views

So in Drupal 7 it was very easy to pass a taxonomy term by name as a contextual filter and it USED to have the option of convert term name to id. What's the equivalent of that in Drupal 8? I've tried the validator as "taxonomy term name" and it doesn't work. When I try to pass it by name I get nothing, but when I do ID it works. So I don't understand how to pass the actual taxonomy term name as the filter.
You first have to create a relation with the taxonomy terms by adding the relationship with the taxonomy list or Taxonomy terms on node. Once you have added the relation, you can now add a contextual filter called name with the category Taxonomy term. This way you can pass the taxonomy term by name to the filter.

Make Drupal 7 Group by always show grouping field

I have a Drupal 7 view similar to the one described here: Drupal 7 Views - list group by field
I wish to have all the groupby fields always appear even if there are not members of them and ideally I wish to put a default value in such a list.
eg:
Foo:
-Jay
-George
Bar:
-Barry
Boo:
Sorry no entries at this time!
Suggestions?
If none of what you are fetching with the view is associated with the group 'Boo' then the view doesnt know it exists, so would never be able to show it but say there is no results for it.
What i would recommend is creating a taxonomy vocabulary with the terms: Foo, Bar, Boo.
In whatever content type your names belong to, create a term reference field, and link them to the terms.
In the view, fetch the taxonomy terms, create a relationship to the content type that references the taxonomy, and pull those through based on that. There is a setting in views for multiple results to combine into one field (so you would want to do that). Then you could add the 'Sorry no entries at this time!' as a field's no results text.
So to recap: VIEW => TAXONOMY TERMS => NAME CONTENT

Drupal - Taxonomy page (show all terms of vocabulary)

I am kind of new to drupal (version 7).
I have taxonomy vocabulary with terms.
Example structure:
Taxonomy vocabulary: Address list
Terms:
Address 1
Address 2
Address 3
How can i create page with all these terms for this taxonomy vocabulary? Even if term is not associated with any of content?
Basically i need an page, that collects all terms from Taxonomy vocabulary called Address list and shows all terms that are created for this taxonomy vocabulary.
I know in drupal there are always many ways how to create things. I need most simple, without hardcoding.
I don't need full solution - any good road/idea/advice.
Thank you.
Install Views module. Add new view & select Taxonomy terms of Type Address list.

Drupal Views: Get nodes with the same taxonomy as the current node

I have a Content-Type with taxonomy-terms. It's a select-list, so it can have only one taxonomy - at least of that vocabulary. Now I need to build a view that lists all nodes with the same taxonomy.
Thought that this wouldn't be too hard since it sounds pretty basic. Yet I can't get it working. Any ideas? I'm trying to avoid writing a module for this.
While this was technically possible with Views 2 as described in some of the other answers, Views 3 has this integration built in.
You can create an argument for the taxonomy term id and then choose "Provide default argument". This will then give you an option for "Taxonomy Term ID from URL" and "Load default argument from node page..."
This will allow you to take the taxonomy of a page and pass that as an argument to your view block.
Note: Views 3 is currently in Alpha 3 but in my experience is at a relatively stable state and I am using it on production sites. If it has features like the one above that you find useful please use it, test it and submit bugs/patches if you encounter any issues!
This answer works in Views version 2 or higher. First you need to install Views attach ( http://drupal.org/project/views_attach ). Please read about Views attach before proceeding further. Views attach is best explained by this video http://mustardseedmedia.com/podcast/episode37
Now we get to Views attach. Please enable the views attach module before proceeding. Essentially Views attach attaches a view at the end of the node. In our case our view will be a listing of other articles with the same term.
We will essentially need to "pass" the taxonomy term of the node to the view. Let the name of your Vocabulary be called MyVocab.
Steps to make the view.
Lets call the view display_other_articles_with_same_taxonomy.
Add a display of type Node Content (available after enabling Views attach). This is a display just like block and page displays but with special ability of attaching itself to the node.
Make the following settings in the Node Content Display
Node content settings
Node types: [select the content types you are interested in seeing the list of nodes with same taxonomy term]
Build modes: Teaser, Full node
Arguments: token
Show title: No
You should select Use tokens from the node the view is attached to under Arguments. Let the token be [term-id] This is the "ID of top taxonomy term". This is very important!! Essentially you are going to be passing the taxonomy term of the node from the MyVocab (See http://groups.drupal.org/node/11788#comment-38332). If it has the lowest weight, the taxonomy vocabulary will be the first vocabulary in the taxonomy section of your node edit form. Add an argument Taxonomy: Term Id.
Add the fields you are interested in e.g. Node: Title. Make sure the Node: Title is made into a hyperlink by ticking Link this field to its Node
So what this view is going to do is:
Take the taxonomy term from the MyVocab vocabulary in the Node that is currently being viewed
Pass that as argument to the view display_other_articles_with_same_taxonomy
List all the nodes that have the same taxonomy term as the node being displayed.
Thats it!
If you're using Views 3 (currently at alpha3 at the time of writing) and you want a block (right now the articles have same taxonomy term come at the end of node body) you can do it in the following fashion:
Forget about views attach... its not required
Add a block view. It should contain the same argument, fields and filters as the instructions above for the Node Content display.
You need to modify the settings for the argument Taxononomy: Term Id just slightly: Under Action to take if argument is not present: choose [x] Provide Default Argument. Choose [x] Taxonomy Term ID from URL. Now make sure [] Load default argument from term page is unselected and [x] Load default argument from node page, thats good for related taxonomy blocks. Also [x]Limit terms by vocabulary and choose the Series vocabulary.
Make sure you name the block and put it in the appropriate region.
Note: This answer is subset of the answer I provided at How to just show NodeQueue block on included nodes? In that scenario the requirement was that the related articles are explicitly selected and listed in a particular order. Its a little more complex and uses Nodequeues which we don't need here at all.
Use relationships
Node 1 -> Relationship 1 -> Term // This will be relationships->taxonomy->term
Term -> Relationship 2 -> Node 2 // This will be relationships->node->node
Argument NID to filter NODE 1
Fields or node full view on Relationship 2 (you will see select box on field adding form, to determinate what NODE to use)
Views gives you the options to add filters. Click the plus sign in the filters area of the views admin UI, select Taxonomy from the list, check either Term or ID, and fill in the value that you need to filter by.
EDIT (for explicit instructions):
First, add the necessary fields that you want under the fields section that you want to display from the nodes that you are trying to filter such as node title, etc.
Under Arguments, click the plus sign and select Taxonomy
Check Taxonomy: Term and click Add
Click Update
In your preview area test it out by adding an argument and clicking preview. If it doesn't work, your nodes do not have attached taxonomy, your views module is corrupted, or you didn't follow directions.

Resources