By stevenpatz on
I have created a View with four fields. One of these fields is a CCK field. I need in this View for that field to be a clickable link to the node. However it appears that Views only allows Node:Title to be used as a link to the node. Is this correct?
I am using
CCK 5.x-1.10
Views 5.x-1.6
Comments
I needed to do this a few
I needed to do this a few weeks ago and I used the Computed Field CCK module.
You create a new (computed) field that will hold the "clickable" version of the URL, setup the computation bit (there are examples) and then display this field instead of the original in your view. Here's the code I used to compute my field:
It's certainly possible that there's another way to do this, so you might want to wait for other responses or for someone with more experience to say this is a good approach.
this is a start, thank you.
I'll try this first thing tomorrow morning.
A little help, please.
I have this as my computed value:
I edit my View and am able to pick as one of the fields the computed value ( I called it HeadlineLink) I save my View and then go view it. Instead of a clickable link though all I have is n/a in plain text. Did I miss a step? Is the computed value code not right? I think I have the logic of the code correct. It creates a link and saves it as $link and then it sets $node_field[0]['value'] to that value.
Do I need to do something else?
Got it to work.
This is what I had to do:
I was missing the node_save, and in your example the
if ($node->field_staffbio_display_website[0]['value'] == 1)block was always false, that was why I was getting 'n/a'.
Thanks so much for the help.