Question

Getting started with Drupal (specifically CCK and Views), so forgive me if this is a basic question.

I'm have some fairly complicated Views that display some Custom Content types with an Attachment below so that I'm essentially seeing multiple tables joined together in one view.

Let's say these pages are accessible via /person/64, where person is the view name and 64 is the node id.

In various parts of this view I'm displaying Node fields, which when clicked on take you directly to it's node.

This is what I don't want to happen. Instead I want a Node link to take you to a corresponding view. So instead of /node/128, I'd like to rewrite that as /event/128.

I tried creating a custom link in the view, but the right parameter isn't available to me. The best I can do is write the link as /event/EventTitle but that doesn't work with the way inheriting arguments in my Attachment.

What's a clean way to do this?

Was it helpful?

Solution

Try adding the Node ID as one of your fields and checking the 'Exclude from display' box so it doesn't turn up in the output.

Then on the configuration for the Node Title field check 'Rewrite the output of this field'. If you have the Token module installed, the Node ID will turn up as a token which you can inject into your custom link.

OTHER TIPS

You should use the template_preprocess_views_view(&$vars) hook
and modify the links within the hook.

Good luck, it can be challenging.

You might also consider checking out the Views Attach project if you're interested in embedding Views data into a node. From your description I'm not sure if some of the URL trickiness came from the need to do that, in addition to displaying the target node itself.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top