I've set up taxonomy in Drupal 7 called Colours. I've added some terms (red, blue etc) and added a colour image to each term.
In a content type I have added a term reference field, so my client can choose colours (the colours in which that product is available).
In Views, rather than listing the taxonomy terms on the node page, I would like instead to output the image associated with the taxonomy term.
Any ideas on how to do this? I've tried endless "output this field as" in Views but just can't get it to work. The only way I've actually got it to work is to upload images when adding content, but that's not ideal obviously.
In Drupal 7 you have to add the taxonomy under "relationships". Then the taxonomy images will appear as fields in the view.
I had the same issue, all I did was adding a new field called "image" to the taxonomy and inside the view I just called that field. its working well.
Your best bet is to create a View Template, and in the template you can look at the value in that field and load the appropriate image in its place.
Here's a guide on doing this in Views 2: http://www.group42.ca/theming_views_2_the_basics
Couldn't find one for Views 3
Related
On a taxonomy term page, the taxonomy term info is shown first, followed by related nodes. I want to add a wrapper div around the related nodes (ex. class="related-nodes").
taxonomy-terms.tpl.php controls the display of the taxonomy term's fields, but I'm not sure how the nodes show up. I was thinking about making a node template for the taxonomy and doing something like render($content['nodes']). However, I'm not sure what the $content key would be for the related nodes.
One approach is to enable the Taxonomy term view display (is disabled by default).
In the view config, you can add classes by clicking in Settings of Format option.
Hope it helps.
Regards.
I'm making a views slideshow of some images.
These images have a title.
I would like to expose this title as a drop-down list filter.
I'm able to do this with pr-configured filter values, but i want this list to be build by the values that the end users gives as a title to a image. (or made of another field like description etc...)
So, when a user uploads images with a title "vacation", i would like this value to come up in the exposed filter in the views slideshow...
Thank you
This can easily be done using the Views Reference Filter module.
Create a views page with the fields you wish to display.
Add an Entity Reference display to your view.
Set which field should act as your search field in the format settings of the Entity Reference display (in this case Content: Title). Remove or exclude all other fields for this display only (override).
To your page display add a filter Content: Nid (entityreference filter) and expose it to visitors. Remember to select the correct view in the "View used to select the entities" drop down if you have more than one Entity Reference views.
Optional steps:
Enable Ajax for your view.
Set the exposed form style setting to auto submit.
If I were trying to accomplish this I would add a taxonomy vocabulary for these images, then I would add a field to the image content type referencing this vocabulary.
After that, I would use create a Rule that would react to saving a new image and add a new taxonomy term to that image that is the title entered.
You can then easily create a filter in views to filter off that taxonomy term and expose that as a dropdown. By doing this each image should have a taxonomy term attached to it that is the image's title. As images are added the taxonomy terms should appear in the dropdown.
Let me know if you need any additional guidance.
I have a view that displays teasers of content type X (across all topics). Under each teaser, I would like to display links to instances of content type Y that share the topic (taxonomy) of that teaser. This seems like it should be relatively simple, but I'm having a hard time relating the filter criteria to the taxonomy of each line of the View's output rather than the taxonomy of the whole View page.
You can use the Views Field View module to do the trick: https://drupal.org/project/views_field_view
I have a content type called product-templates. In this content I capture the following fields: Title (core), content body, taxonomy term reference, and 6 different file types. A new product-template content is created for each template we have. So let's say our products are widgets, broken down by color.. blue, black, brown, pink, green, etc...
The taxonomy has the primary product template categories, for example: blue widgets, black widgets, etc.. Each will have multiple templates for the different sizes, so the term will reference size/style, widget small, medium, large, square, round, etc.
Using the default taxonomy override that comes with views taxonomy/term/% and limiting the filter to product-templates and using fields, rather than full content I get a list something like this: blue-widget small -> template b1s, template b2s, template b3s… / blue-wiget medium -> template b1m, template b2m, and so on. So what I end up with is a full listing on all the product templates with their associated template files.
What I would like to have happen is that when the visitor is on taxonomy/term/% they are presented with a drop down or jump menu that shows the different options, then when they click on (for example) blue-widget small the associated templates render/populate on the page. So basically I want to remove the listing and turn it into a selectable area. Since there could be a large number of options/sizes I don't want to have a list that goes 20 scrolls, and I don't want to have to use a pager. It seem more logical to present them a drop down list that has all the options/sizes they select the one they want and then just those templates pull up.
Any suggestions on how this would be accomplished?
You should be able to accomplish this by adding filter to the view which is taxonomy term, then set it to exposed and use the following url to access all documents.
taxonomy/term/all (this should display all documents)
This will mean that it is applied for all vocabularies, so not a problem if you only have one.
I am trying to display different content types on Drupal as views slideshow, including twitter, images, and blogs. Currently they are all saved in a field (unlimited value fields). I am going to extract these values to nodes as views only accepts node type values. I am wondering what is the best way to do it? I am new to drupal and can think of following ideas:
1. Use one node type, and create a display mode for this node type with customized codes
2. A separate node type for different content types, and each node type with some display mode
3. A minipanel for each node type,is it possible to display it in view slideshow?
4. some code to get data directly from fields, and export to views?
5. Or I use Colorbox and completely forget about View Slideshow?
Please help. Thanks.
You must set all the content types you want to pull in the query in the "edit" form of the view. It is not possible using only the one-step setup, you must choose "continue & edit" and then add different content types to your slideshow view.