Hi,

Does anyone know how I can get the Taxonomy terms from the images into my scrollable node.

I have, as you'd expect, a number of images scrolling nicely past but I want each image to be able to navigate to a view Slideshow of similar taxonomy terms.

Is this at all possible?

Many Thanks in advance. Drupal rocks btw

Comments

pecker’s picture

Assigned: pecker » Unassigned
pecker’s picture

I feel I need to clarify (I'm not sure I made much sense);

The scrollable module is working well and because I have this set up as a view, I have two fields being output-> The Image and related taxonomy terms.

I guess I have two questions;
Is there a way of altering the href in the scrollable item div to pass these terms to a new node?
Is there a way of changing the filters in a different node using the answer to question 1?

I have my scrollable view (showing all preview images) and also a view showing the full size images, which can be filtered by taxonomy term. Currently this filtering is done via an exposed field but I really want to control the filtering by which preview image is selected and which taxonomy terms they come with.

I hope this makes sense....please let me know if not

pecker’s picture

Ok,

Who was it that once said "It's only easy if you know the answer" ?

Here's how it's done;

1. Set up your scrollable view to output fields (rather than nodes)
2. Set 2x fields (this is important)- Node: nid + Image
3. When configuring the Node: nid field select the "Exclude from display" box (you only have this fields so you can reference it in the image field)
4. Rearrange you're fields so that Node:nid is at the top. And your image field at the bottom.
5. Click on you image field to configure it.
6. Select the "output this field as a link" box
7. In the "Link Path" box that appears enter the path to the full page node that you want to filter by taxonomy term, followed by the replacement pattern for you excluded Node:nid (this is [nid]). I entered "images/[nid]"
8. Update and Save your scrollable view.
9. Now everytime you click an image in the scrollable view you will be directed to something like http://www.example.com/images/5
10. If you don't already have a full page node with url of "images" (in your case this will be what ever you put before /[nid]) you need to create it now
11. Within the configuration of this full page view, press the + in the arguments sections to add an argument.
12. In the "groups" dropdown, select Global
13. Check the box next to Global: Null
14. In the "groups" dropdown, select Taxonomy
15. Check the box next to Taxonomy: Term ID (I know, your thinking "hang on, he didn't add Taxonomy in scrollable" - This will all become clear)
16. Press the add button and you will move on to configure the Global: Null argument - Leave all as it is and press update
17. Now to configure Taxonomy: Term ID
18. Under "Action to take if argument is not present:" select the "Provide default argument" radio button
19. Under "Default argument type:" select the "PHP Code" radio button
20. In the "PHP Argument code" box paste the following code (without the php tags at the beginning or end)

$terms=taxonomy_node_get_terms(node_load(arg(1)));
foreach($terms as $term) {
  $t[]=$term->tid;
}
$tids=implode('+',$t);
return $tids;

21. Select the "Allow multiple terms per argment" check box
22. Press the Update button and Save (you may get an error on updating - this is because it doesn't have a node:id. It will work when you try it for real)