Hi,
I m struggling to do something certainly simple with Display Suite.
I have created in a content type, a list of term (banana, peach...) from a vocabulary taxonomy called "fruit".
In Display Suite, I have created a "code field" using the token [node:field_fruit]. The result of it, is that the term "banana" (or peach) is correctly displayed on my node.
I tried to put a link on the token [node:field_fruit] using <a href="[node:field_fruit]">[node:field_fruit]</a>. The result of it is www.mysite.com/content/banana
The problem is that I m trying to the get the URL : "www.mysite.com/fruit/banana" in order to display all the node that refer to the term banana.
How can I do this ?
Comments
Comment #1
luketsimmonsHi filnug,
I was just looking for the same thing, and managed to get it set up but it kind of depends on the output you want afterwards?
Basically, you have to -
Code field
<a href="[node:field_fruit]">[node:field_fruit]</a>replace the node field tokens with taxonomy ones, i.e.<a href="[term:url]">[term:name]</a>Set the code field for the taxonomy output
Set format for your taxonomy field
This will get you the output for the taxonomy term how you defined it in your post, but it does mean you will have one div wrapper from DS for the one column layout. Ideally you could add a custom layout that doesn't use any extra formatting so that you get a nice clean output for the taxonomy field.
If you aren't fussed about an extra div then this should work for you.
The alternative is if the taxonomy term field when referenced via a node token had all the extra attributes available, ie pathauto alias, path, etc. But from hunts around the web and drupal.org that appears to not be available yet.
Let me know how you get on.
thanks,
luke
Comment #2
swentel commentedWaauw, great steps, thanks!
Comment #3
filnug commentedI didnt had time to test it, but I have to admit that the answer look pretty complete. Thanks @uketsimmons for taking time to write this feedback!!!
Comment #5
jive01 commentednot sure the above solution would consider this issue fixed. It's kind of a hackish round about way to do things. Would be more ideal if there is simply a url token made available..
Comment #6
kopeboyWhat if I want to output some text together with the link and translate it?
Something like "Search for businesses in this category" below a node of type article,
where businesses is another content type that uses the same taxonomy vocabulary, category is the term in question, linked to the page showing business of that category.
Will I be able to translate the displayed field?
Comment #7
aspilicious commentedAs you can see, I don't have the resources to answer support requests.
Closing now, please drupal.stackexchange.com for support questions.