How to redirect a menu link to last published full node

Events happening in the community are now at Drupal community events on www.drupal.org.
mxt's picture

Hi all,

Is it possible to achieve the following result with rules?

I have a primary menu link "articles" and I want that it would point to last published full node of a particular content type (articles).

I know this can be simple obtained with Views sorting nodes for data, but I need that that user will be redirect to a NODE page, not to a views page.

Thank you very much for your help!

MXT

Comments

what you really want to do is

letapjar's picture

what you really want to do is re-assign the path alias for the menu item whenever a new article is published

on event after updating existing content

if content has type 'article'

AND

updated content is published

AND

unchanged content is unpublished

DO:

create or delete a url alias

LEAVE "Existing system Path textfield blank

  • under the "path alias setting" type 'articles' (or whatever your menu link is)
    save

This actually deletes the path alias

add another action
create or delete a url alias

this time - for existing system path enter: [node:node-path-raw]

for path alias enter: 'articles'

this re-creates the path alias

Also, since newly created articles may be published directly - you may want to clone this rule and change the event to

After saving new content

if content has type 'article' AND content is published
DO
...

Rules

Group organizers

Group categories

Categories

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: