0
votes

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?

3
I think it would be better to explain the problem you are trying to solve in more detail, than trying to get help with the solution you have already come up with. There may be a simpler way to achieve what you are trying to accomplish than mucking with something as fundamental as node paths. What I'm wondering is how are your users getting node number links, and how could you change those to point to the views you want them to see.JeffP

3 Answers

0
votes

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.

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

Good luck, it can be challenging.

0
votes

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.