1

So I have a content type called MyContentType and two views: mycontents and mycontent/%.

mycontents shows all MyContentTypes with a pager. mycontent/% shows a single MyContentType based on node id.

How do I make it so when clicking on a content's header in mycontents (or any other way of displaying MyContentType) takes it through to mycontent/[nid]?

3

Use Views 'rewrite output' feature for the Field: Title field on your mycontents view.

First, make sure you have added the Content: NID field to your view. If you don't want this to be visible on your View, you can 'Exclude it from display` as noted in the graphic below.

Exclude from display

You will also need to reorder your views fields to ensure Content:NID is listed before your title so you can access it in the next step.

enter image description here

It's very important to to note that the Content: Nid field is above the Content: Title field.

Next, edit Content: Title and scroll down to and open the 'Rewrite Results' section.

Note: You may need to uncheck the 'Link this field to the original piece of content' checkbox for the Content: Title field.

In the 'Rewrite Results' section, check the box titled 'Output this field as a link.' In this section, if you scroll down, you will see a link titled 'Replacement Patterns.' This is where we will get the variables we need for our URL.

In the 'Link Path' box, enter your destination URL: mycontent/[nid]

enter image description here

Don't forget to save your view, but your titles should now be linked properly.

| improve this answer | |
  • I think you may just be my favourite person. This worked a treat! Thankyou! – dav_i Sep 18 '12 at 8:20

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.