0

Currently I have a custom view that lists a series of nodes. One of my fields is "Content:Title" and I have checked "Link this field to the original piece of content". Everything works.

Question: For my list of nodes I would like to selectively "unlink" some of them and have the text remain. So in a way, it would be a preview of what's to come. Then when I am ready to link them I will "reactivate" the link.

Example:

  1. Title 1
  2. Title 2
  3. Title 3
  4. Title 4
  5. Title 5

1 Answer 1

2
  1. Add a boolean field to your node to determine if the link is shown or not. Let's suppose it's called Show Link

  2. In Views add the Title field and then check 'Exclude from display'. Don't check 'Link this field to the original piece of content' here.

  3. Add a Field that you can use to build your link, e.g. Content: Path. (You could also use Content: Nid.) Check 'Exclude from display' so this does not show.

  4. Add the Show Link field and select the formatter type to be Key - this is important! it won't work without it

  5. Rewrite the output of the Show Link as, e.g. [Title]. Check the box to 'Output this field as link'. And then fill in the path box with, e.g. [path] or if you've gone the Nid route node\[nid]

  6. Now edit the No results section of the Show Link field. In this case you want to output the Title without the link, e.g. [title]. Check the 'Count the number 0 as empty' In my testing I also have 'Hide if empty' and 'Hide rewriting if empty' checked.

Make sure you order the fields so that the ones providing the tokens for the rewrites come before the Show Link field.

1
  • Obliquely that worked great! Thanks so much for taking the time to write it out. Make sure to mention in step #3 that it also needs to be excluded from display.
    – Dan
    Commented Mar 16, 2013 at 0:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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