Closed (fixed)
Project:
Views Custom Field
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
7 Dec 2008 at 11:20 UTC
Updated:
27 Dec 2008 at 11:13 UTC
I am using views to create a list of the different term names in a vocabulary, but i don't want them to link to their taxonomy, but to another page.
How do i do this, i have this code at the moment (i'm sure $term->name is wrong).
print $term->name "> print $term->name
I have the term selected as a field but when i do
print var_export($data, TRUE);
it comes back as NULL.
Comments
Comment #1
chris_huh commentedDrupal did some weird stuff with the code there, so here it is again:
<a href="<?php print $term->title ?>"><?php print $term->title ?></a>Comment #2
casey commentedWhich customfield are you using? "PHP Field" or "Markup"?
I was able to get this to work with a view (type: Term):
2 fields:
- Taxonomy: Term (set "exclude from display")
- Customfield: PHP Code
with value:
Comment #3
casey commentedComment #4
chris_huh commentedAh yes, now i feel stupid. I was using markup, not realising there was a php one. Thanks.
Now the only problem is that is generates the term name fine but the argument that extracts that term name in another view doesn't recognise it as it expects spaces to be dashes.
What would the php code be to convert spaces into dashes in the url?