0

On my site I have two front pages:

  • node/31, for anonymous users
  • calendar-node-field-journal-date/month, for logged in users

When a users clicks on the front page (which is rendered as $front_page in my page.tpl.php file), I want them to be taken to the appropriate front page.

However, if a logged in user goes to node/31 directly (e.g. by not clicking on the front page link) they should still be able to see the node (and not be re-directed).

After researching, I've found Rules is the best way to do this and there are instructions here. However, this re-directs logged in users when they visit node/31. How can I get the Rule to only run when the user clicks on the $front_page link and not on the direct node/31 link?

I don't want to set it up via my theme, as I am sharing the theme on a multi-site. I also don't really want to install other modules, as I am already using Rules for other things.

5

I would recommend the Front Page module, not rules:

The Front Page module allows for customised home pages dependant on role. The pages can be of the following types:

Alias (only 2.x branch) - Allows for another Drupal path to be shown as the home page without redirecting the user.

Redirect - Allows you to redirect users to a local or remote URL.

Themed - Allows you to enter some static text that will be placed into the content area > of a standard Drupal page. Full - Allows for static content to be displayed to the screen as is. This method does not pass through Drupal's theming system.

  • this has the same problem as rules: If the logged-in user clicks on node/31 directly they will be taken to the front page. Thanks for your help! – big_smile May 7 '15 at 9:21
  • 1
    then I would suspect that that is expected behaviour - since Drupal associates the node with the Front page, it assumes your intent was to view the front page when the node is viewed – Geoff May 7 '15 at 14:16

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.