Tell me more ×
Drupal Answers is a question and answer site for Drupal developers and administrators. It's 100% free, no registration required.

How can I link Fields in a view to the entity it belongs to, along the lines of 'Node: Link' or 'Link this field to its node' in Views D7? Do I have to define anything special to give me a field in Views Field to pick from to enable this?

Also, instead of just link to the defaultUri, how could I use a pathauto aliased path if it exists instead of the entity uri?

share|improve this question

1 Answer

up vote 2 down vote accepted

The link to node or link to user option you see on some properties in views are special. The reason the possibility is there, is because Views has added the option and functionality in a special handler.

Things are not that easy with fields since they can be attached to anything, which makes it much more complex (compared to nid, uid, title and username). You could probably do this with some code, but usually it's much easier to use the rewrite result option, and select output as link and type in the link with tokens: node/[nid]. I'm not sure, but I believe the Views will run the link through l or url enabling path auto.

share|improve this answer
Yeah, I tried entity/[entity-id] which does enable a link, but it does not get aliased. Hmm.. – Kevin Jan 26 '12 at 21:16
Got it! I forgot I cleared my aliases prior while debugging. – Kevin Jan 26 '12 at 22:09

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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