0

How can I redirect all of my nodes created by a content type to a views page with a different url? For example, I created content types for publications and then have pathalias creating a url for a created node:

publications/form-one

I am then using views to reformat that look and feel of the node fields and also add in some other data from other content types via Relationships and Context. In the end my new url is:

publications/001

Now, my search results will find the /form-one url and bring the user to that page, but I'd like to only return the user to the /001 page that I have compiled in views with the additional data.

Some thoughts I have had, but not sure how to implement:

  • If I take all the url alias away from publications and reset it back to node/nid and then .... not sure here? Some Context Redirect?
  • Redirects? I have a TON of pages.
  • hook_node_view()?

Thanks for any thoughts and please ask for clarification if needed.

  • is 001 the path because it's the first publication, or the first node? It's hard to give a concise answer because the way you construct the path for the view can influence the final solution – Trey Sep 25 '15 at 21:38
  • no... sorry, it could be any number. – jasonflaherty Sep 25 '15 at 21:51
  • how would you then determine which number to forward your request to? is there a field that specifies? this seems like something that would be best handled using panels if you want to avoid writing custom functionality – Trey Sep 25 '15 at 21:53
  • I think thats I where I am stuck. I am taking all my nodes back to node/nid and then have my view creating publications/form-one. So Node NID basically needs to redirect somehow to the views page... – jasonflaherty Sep 25 '15 at 22:00
  • 1
    the panels module provides a panel that will override the default node display and allow you to add a view or any other content to it, it sounds like exactly what you are looking for, short of writing your own solution, I don't know how to accomplish what you want using only views – Trey Sep 25 '15 at 23:25
0

Chaos tool suite (ctools) has a sub-module called Page Manager.

Page manager is a critical tool for Drupal development. It's a sub-module of Chaos Tools that enables you to change the paths of pages, even some of those defined by Drupal core. While it won't change the appearance of a node, it can change the context of it. With Page Manager you can control who has access to pages, and how they get to the pages, including nodes that are part of other pages. Working hand-in-hand with other modules like Panels, Page Manager can help give you great control over the user experience.

Using it you can do redirects on a specific content type to your view and pass along the context such as the nid. No need to worry about aliases.

You do it as follows:

  1. Activate Page Manager
  2. Go to admin/structure/pages
  3. Enable /node/%node to override it.
  4. Create a variant with a 301 redirect
  5. Create a selection rule on Node Type = Your node type
  6. Set the redirect destination to your-view-path/%node:nid
  • This might be the ticket. I'll give it a shot! – jasonflaherty Sep 28 '15 at 18:19

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.