Hi, I have a view of some CCK contents.
So, the row style is "Fields".
I use Pathauto so each CCK content has a specific path.

I am interested to add to my view a link of each CCK content. So i added the following fields to my view:
Node: Link

the problem is that in the page created the link appears like that:
<a href="/XXXX">view</a> (view)

i am interested to extract the link http://www.example.com/XXXX because i have to show the link like following:

<a href="http://www.example.com/XXXX" class="postuler">More Info</a> (More Info)

I try to use the view theming (templates) but the $output variable appears like the first link below and i didn't find how to extract the link.

my problem is on the following link : http://neway-si.com/missions_liste
( this web site is a french web site...)

thank you for your help

Edited by WorldFallz - moved to appropriate forum.

Comments

ephy’s picture

...anybody can help me please ???
10x

PS: from now, i'm using the node id and build the path (/node/XX) but it's workaround with duplicate content
not so good...
Please help !!

ephy’s picture

...

justageek’s picture

I think you have to go 'deeper' and use the views template that handles the individual link field itself. If you use theme information in your view, it will give you a detailed list of templates you can use, and the farther down the list you go, the more control you get.

Another option would be to use a standard text cck field instead of the 'link' field, and just store the URL of the link, then create the html for each link in your views template. So, your cck field could be 'url' and you would store a value like 'http://www.yourdomain.com/xxx', then you can output the html you want for your link.

I hope that makes sense.

ephy’s picture

I found the problem on the following link:
http://drupal.org/node/352311

Ephy
http://www.forexorama.com

tarzadon’s picture

I tried the suggestions on the link you provided and still didn't get the link back.

Which function did you use?

tarzadon’s picture

I didn't see that you changed to using Node:Nid instead.

Using Node:Nid, I was able to construct the URL using "drupal_get_path_alias("node/".$field->content);"
If I checked off "Output this field as a link", then I wasn't able to get the alias.

I was also able to get the URL out Node:Link:
$lnk = preg_replace('/<a href=\"(.*?)\">(.*?)<\/a>/', "\\1", $field->content);
Then I constructed the URL by appending $lnk to the end.