Great module, thanks. I solved all my problems with it, however www.example/node is still visible (and should the default Drupal install welcome page as I have not promoted any content to /node. In fact, no on e should ever see that page at all as it will never hold content). I was hoping that it would be included in the front_page redirect for www.example.com

Is there any way around his?

Comments

Phillip Mc’s picture

Title: examle/node still visible » disabling the node page
Assigned: Unassigned » Phillip Mc
Status: Active » Fixed

this isn't really a front page issue...but, it might be an interesting feature request...i.e. offer a checkbox to override the www.example.com/node page.

however, one quick way of disabling the /node/ page would be to create a mini module using a snippet like the one below, which returns a 404 "page not found" message. edit sitename to suit.

function sitename_menu($may_cache) {
  $items = array ();
  if ($may_cache) {
    $items[] = array (
      'path' => 'node',
      'title' => t('Not Found'),
      'callback' => 'drupal_not_found',
      'type' => MENU_CALLBACK,
    );
  }
  return $items;
}
NeuZeitgeist’s picture

How to use your snippet?
I put this code to document type "page", enabled php code filter but there are no changes. I can still see node page.
Thank you.

Phillip Mc’s picture

StatusFileSize
new17.47 KB

I'm going to suggest this to Dublin Drupaller as a new feature in the new version of front_page.module - he's working on it at the moment.

If you're in a hurry....follow these steps to patch your existing front_page.module:

  1. Make a backup of your existing front_page.module file and a copy for editing
  2. Open up the front_page.module in a texteditor like PS PAD or notebook
  3. scroll down to line number 38 where you'll see this function:
    /** 
     * this function sets the necessary paths etc. so drupal
     * knows where to find the front_page
     */ 
    function front_page_menu($may_cache) {
      $items = array();
      if ($may_cache) {
       $items[] = array('path' => 'admin/settings/front',
          'title' => t('Advanced front page settings'),
          'description' => t('Specify a unique layout or splash page based on role type - override your HOME and breadcrumb links - display a custom mission style notice for users who haven\'t visited in a while - disable site and display a \'temporarily offline\' message.'),
          'callback' => 'drupal_get_form',
          'callback arguments' => 'front_page_admin',
          'access' => user_access('administer menu'));
       $items[] = array(
          'path' => 'front_page',
          'title' => t(''),
          'callback' => 'front_page',
          'access' => TRUE,
          'type' => MENU_SUGGESTED_ITEM);
          }
      return $items;
    }
    
  4. replace all of those lines with this:
    /** 
     * this function sets the necessary paths etc. so drupal
     * knows where to find the front_page
     */ 
    function front_page_menu($may_cache) {
      $items = array();
      if ($may_cache) {
       $items[] = array('path' => 'admin/settings/front',
          'title' => t('Advanced front page settings'),
          'description' => t('Specify a unique layout or splash page based on role type - override your HOME and breadcrumb links - display a custom mission style notice for users who haven\'t visited in a while - disable site and display a \'temporarily offline\' message.'),
          'callback' => 'drupal_get_form',
          'callback arguments' => 'front_page_admin',
          'access' => user_access('administer menu'));
       $items[] = array(
          'path' => 'front_page',
          'title' => t(''),
          'callback' => 'front_page',
          'access' => TRUE,
          'type' => MENU_SUGGESTED_ITEM);
          }
       else {
        $items[] = array (
          'path' => 'node',
          'title' => t(''),
          'callback' => 'front_page',
          'type' => MENU_CALLBACK,
        );
      }  
      return $items;
    }
    
  5. Save your new front_page.module and upload it to your site overwriting the front_page.module file on your server
  6. Now when you go to www.example.com/node you should be directed to the front_page

Hope that helps. Like I said earlier, I'm helping with the update of this module, so I'm going to suggest it as a new feature and it will be included in future versions along with a checkbox on the settings page that says "Override www.example.com/node page?".

I have attached an amended front_page.module (version 5.9) with the above changes already made if it's of use (Just remove the .txt extension)

I have tested the module and it works as expected, although if you experience any problems with it, just delete it, replace it with your backup copy of the module and report back up here.

NeuZeitgeist’s picture

Thank you very much for your answer! I'll do like this.

NeuZeitgeist’s picture

StatusFileSize
new42.28 KB

It works but there is a little bug. When you go on page www.example.com/node there is additional title "Content" on the page. Se screenshot.

Phillip Mc’s picture

I can't recreate that error. do you see the 'content' page title when you go to the front page normally?

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.