In views,the default "title" field has an option "Link this field to the original piece of content " so that it links to the original node but it is not present for other fields.How to link these to original node?
A list of fields is being displayed but they are not linked to their respective nodes.
Are there any replacement patterns that can be used in the "rewrite results > Output this field as a link " ?
Or is there any other way?


Ayesh’s picture

I have seen such check box in some fields but not sure about that.

The answer is, yes, you will have to use "output this field as a link"(Try to avoid field rewriting for URLs because you will face many troubles if you move your site's domains or subfodlers.).
In Views fields, load the Node:link and setup options to get it as plain text. i.e. without linking to the node with an A tag. Check "exclude the field from display" option in that field's options.

Then you can add this "node:link" as the target of the other CCK field.

// Ayesh

WorldFallz’s picture

Try to avoid field rewriting for URLs because you will face many troubles if you move your site's domains or subfodlers.

Sorry... but this makes no sense. Regardless of which option you choose, you will always have link problems if you use anything but root relative urls and then change the domain. Likewise, if you will always have invalid links if you use subdirectories and then change them at some point. It doesn't matter which option you use. From what I can see, the link option is just a bit of a shortcut or convenience for those that don't know the full syntax of the anchor tag.

Ayesh’s picture

Ah, yes...
I was crazy. both custom rewriting and "output as a link" option give troubles unless we use relative paths or PHP base paths to get the base domain(useful fur Feeds, etc).
Sorry for my bad reply.

// Ayesh

koneru’s picture

Yup,got that.But used content:path instead of content:link in drupal 7.

Cannot set content:link as plain text.In Drupal 7 content:link returns an anchor tag.Replacement patterns also returns the whole anchor tag.

Yuri’s picture

Drupal 7: Using the content:path method mentioned above, i still have an issue:
trying to get a non-title field linked to its node
This is what i did:

Placed content:path before the field X
Field X - Rewrite results - Output this field as link - Link path: [path]
The result was:
- path: /bar/foo (left it unhidden to check output)
- field X links to: foo/bar Page not found, because it is not converted to the full url

Then i ticked "Use absolute path" in the same field X rewrite settings, which resulted in the field X linking to
Although that displays the correct page to the node content, that double slash should be one slash.

How did you guys accomplish this?

franc23’s picture

Late as this reply may be...hoping that it helps someone else with the same issue.

1. Place content:path before the field X. Check "Exclude from Display". Expand "Rewrite results" and only check "Use absolute link" for this field.
2. Field X - Rewrite results - Output this field as Link - Link path: [path] . Do NOT check "Use absolute path" here again.

nicodv’s picture

I'm new with this level of views usage. My problem is how to use the real syntax of links (or tokens)
You said to use [path] (I understand this is the theory) this takes me to the first listed views page (one I created before). If I want to send the user to a concrete page, what would be the syntax or procedure? Can you at least point me in the right direction?

Thanks a lot (i've been some hours trying to accomplish this :P)


CisaWeb’s picture

Thanks a lot! I wasn´t able to find the solution and this reply saved my life. Thanks! :)

CD’s picture

Thanks Franc23 this just worked for me!

xtian7’s picture

It helped me a lot

gagarine’s picture

On Drupal 7 I do it in this way:
- add the field you want
- add the field "Content: Link"
- in the "Content: Link" settings in "Rewrite results" active "rewrite" and use the token of your first field. The token is something like "[field_yourfieldname]" but you can see under the replacement pattern.

It's important than your link field is after the other field.


dsemblano’s picture

Great tip, thanks. A correction: instead "Content: Link" you must add "Node: Link" in D7. And you may want set "Exclude from display" in the field you want settings. An example is to display a body content in a teaser, linking to its node (like "Link this field to the original piece of content" in Content:Title settings).

kellyimagined’s picture

This was it, this is the answer.

irinae’s picture

Thank you Gagarine! Worked for me beautifully!

wscomn’s picture

Nice solution, gagarine! Thanks!!

timothykc’s picture

I've confused myself many times with this too! Here's the procedure:

Assuming you wish to turn Field_X into a link, the fields must be listed as follows:

Field_X (should click exclude from display)
Content: Link

What you do with the content link is "Rewrite Display" and simply put in the token for [content_Field_X]

franc23’s picture

Content:path works better than Content:link for two reasons

Instead of using Content:Link for each field that should link to the node, Content:path just needs to be defined once above all other fields. Any field can then reuse this as needed based off this step:

Also, the hidden field to be re-used by other fields should be the link/path field and not the Field_X field.

codesmith’s picture

For anyone who comes here looking for a way to get just the path to the full node:

1) Install View Path
2) Add a Global PHP field
3) In the Value Code box put

return 'node/' . $data->nid;

4) In the Output Code box put

echo "URL to this content is:<br />" . url($value, array('absolute' => TRUE));

This works for D7 / Views 3.

WorldFallz’s picture

wowsa... installing views_php just for this (if it's installed already for other reasons that's different), which can be done with views alone, is like hammering a nail with a jack hammer.

codesmith’s picture

It's installed for other reasons but how do you do this with views alone?

rvdtuin’s picture

Can somebody tell me how to get the origanal piece of content displayed in a view?
I created a block (ticker) that shows titles that link to the original piece of content. But i want this to be displayed in a page that I created in the same view that is used for the block (or should I create a new view?).
O and in this page only the content of the link being clicked should be displayed.

I think this thread is the most relevant to submit my comment..

thanks in advance.

Ayesh’s picture

'nide references, user reference, parent node(of a comment) , voting results, node's author and many of the connected content can be shown in the View if you include them in the View.
Add a "Relationship" to the referenced node via the fields in your current view.
It's a little difficult to explain it here. But what you need is Relationships. It's well documented in views docs.

// Ayesh

rvdtuin’s picture

Sorry but I don't understand why you are mentioning this:

'nide references, user reference, parent node(of a comment) , voting results, node's author and many of the connected content can be shown in the View if you include them in the View.

I have multiple links in a block (created with views) and I want the content (when clicking the link) to be displayed on a page (created with same view) and only the content that the clicked link refers to.

I will look into Relationships but I think I need the page view to use a value (from the link? or nid?) to filter. So I have been struggeling with contextual filters for a while now with no luck at all.

Thanks for your reply

katy5289’s picture


This worked for me:
To link field_X to full node, do the following:

1. Place content:path before the field_X.
- Check "Exclude from Display".
- Expand "Rewrite results" and only check "Use absolute link" for this field.

2. Field X - Rewrite results
- Output this field as [path] . Do NOT check "Use absolute path" here again.

virtualwaves’s picture

Hi all,

I know this post is a bit older, but if anyone is interested, there are two tutorials that I wrote around this topic:

Linking fields to external links

Linking fields to its content (with the path-field)

I hope that helps.


tryitonce’s picture

Thanks Katja - very useful tutorial.

Just one thing i found on my multi-lingual site in Drupal 7.
I needed to add to get what I needed in front of [path] in order to get a path that worked like
so it looks like this[path]
Without that I got this: The 2 "//" in front of "en" showed up and rendered the path unusable.
May be I missed something else ..... for now it works ...

Good luck .....
... more recent results of trying Drupal just once are -

turtletrail’s picture

i had the same problem on multilingual site,

what i found out is that writing in the

Output this field as a link

node/!1 will automatically convert it to the right path.

jetwodru’s picture

Great, works like a charm, thanks

TeddyG’s picture

thought this might be useful if any one has the same prb in drupal 7, it worked for me

1) Add node id as a field, if you are not using this field just set exclude from display.
2) Add body field as normal
3) Check the order of items, nid should be on top, if its not just rearrange the fields
4) Then click on the body field and go to output this field as link. And in link field give like node/[nid] and save.
5) That’s it!


WorldFallz’s picture

imo this is the best method. It shows the aliased path if there is one, works in all circumstances where you might use the view, and preserves the table sorting option of the field used for the text.

Pascal.s’s picture

"thought this might be useful"
Exactly what i was looking for!

333martine’s picture

Thanks TeddyG, this worked for me :-)

gpantikidis’s picture

A million thanks TeddyG!! This worked for me too!!

rodpal’s picture

turtletrail method worked great for me. I needed a relative url as the RSS display adds the site url in this format:

I added a NID field, clicked on rewrite results: node/[nid]

The output is the absolute (friedly) url