0

I use theme information to style the output of my view. I'm overriding this file: @file views-view-fields.tpl.php

I access my custom fields by using:

$fields['field_FIELD_NAME']->content

Now I want to get the link to the node. I know I can get the link by choosing "link field to node" in the view settings. However, I don't want each field to link individually, I want to wrap them in a link. Any ideas ? Thanks!!

1

Select the following fields to output:

1- title, body, path, (Global: Custom text) and any other fields you want. and make sure that (Global: Custom text) is ordered last, and all other fields are excluded from display.

2- in (Global: Custom text) settings, use the fields' tokens in the body. [title], [body], then choose "Output this field as link" and in the path just enter the [path] token. (See Replacement Patterns for more details)

Hope this works... Muhammad.

  • Thanks! the path field was so obvious that I haven't seen it! – MonsieurNinja May 22 '12 at 9:45
0

I have 1 suggestion for you, you can exclude fields from display then use its tokens in Rewrite result tabs, then you can add link to this group of fields with "Output this field as link".

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.