0

I have been using the 'rewrite results' option to create links within a view table. Several of these link fields are just plain text, which use replacement tokens to build the link. These fields tend to point to a data set (like UID or title) which are already used in the table. I have been thinking, it seems wasteful to use a field which requests duplicate data.

Example: if I an displaying the NID of a node in a views table, I could use a replacement token to build a 'click here to view this node' link.

Also, I could just use the 'Link this field to the original piece of content' option on an empty field which uses 'rewrite results' to display 'click here to view this node.'

Either way, I'd like to know if there is a way to set up an empty (or static value) display field within a view.

  • I have been thinking, it seems wasteful to use a field which requests duplicate data Could you expand on that? Do you mean the overhead of an extra column in the SQL query? If so, you don't need to worry. The data for tokens comes from the data already in memory, there isn't any overhead. I'm not sure I follow what you're asking in general, but is it that you want to create a custom token? Or a custom Views field handler maybe? – Clive Apr 11 '14 at 18:10
  • I might be a little OCD about my fields here. If including data in a field (that is going to be rewritten) does not increase overhead, then I may as well use some random value (which is already available in that view.) – Hoytman Apr 11 '14 at 18:16
  • The simplest case I can thing of is a 'view node' text link that links to the node using the 'Link this field to the original piece of content' option. This field could be set to anything, then rewritten using 'rewrite results' – Hoytman Apr 11 '14 at 18:17

Your Answer

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

Browse other questions tagged or ask your own question.