Hello,

I would like to have two front pages: the one that people come to when they initially go to the site, and then one that they go to when they are already at the site and click home. The difference between the two is minimal: the 'clean' home pages only has a few sticky nodes on it, whereas the 'working' home page has all of the recent posts on it. Is this something I should do with the Front Page module, or is their another way. Just from reading the Front Page module documentation, it looks like it may take some work to do this.

Thanks,
Scott

Comments

Dublin Drupaller’s picture

Hi Scott..

I updated the front_page.module recently to allow you to override the default HOME link on your site to point to a different page. This includes breadcrumb links. So, let's say you have a nicely designed splash page for visitors to your site...offsite clicks will point to that, while clicks from within the site (i.e. the person is already on your site) are redirected away from the splash page to a page you specify.

It's very simple to implement..just type in the new "home" or "working" front page link..click a check box and save your settings.

Hope that helps..

Dub

Currently in Switzerland working as an Application Developer with UBS Investment Bank...using Drupal 7 and lots of swiss chocolate

scain’s picture

But I feel like I am just missing something: the 'working' home page is equivelent to what is the default homepage. How do I write a link to that?

scain’s picture

I thought of another way to ask the question: I want the front page to be just the sticky nodes from the regular home page. How can I write php to put just the sticky nodes there?

Thanks,
Scott

scain’s picture

I created a node that has just sticky nodes in it and had the front_page module redirect to it (this is the 'clean' homepage). I left the 'bread crumb' links in place so that it would link to the 'working' home page (the default). To get just sticky nodes, I used this php:

<?php

$listlength="5";
$result1 = pager_query(db_rewrite_sql("SELECT n.nid, n.created FROM node n WHERE n.sticky=1 and n.status = 1 ORDER BY n.created DESC"), $listlength);
while ($node = db_fetch_object($result1)) {
$output .= node_view(node_load(array('nid' => $node->nid)), 1);
}
print $output;
?> 
venkat-rk’s picture

Are both the 'clean home page' and 'working home page' at www.domain.com?

scain’s picture

I really thought it did. But now, even though I have "Redirect your site HOME links" unchecked, clicks on links to the default homepage get rediected to the node I described above. What can I do to fix this?

Thanks,
Scott

scain’s picture

Not that anybody else is following this conversation with myself, but I think I got it to work this way: I added the code below to the front_page config:

<?php
/**
* This front_page php snippet checks to see if someone has clicked on
* a "home" link on your site or if they are clicking through
* from an external link or site.
*
* Useful for drupal sites with flash intros.
*
* Change the $yoursite value to your website address
*
* This has been tested and works with Drupal 4.5.x and Drupal 4.6.x
*
*/
$yoursite = "http://www.gmod.org";
$internal = "node/";
$external = "node/86";

// get referrer from _SERVER array
$ref = $_SERVER["HTTP_REFERER"];
// check the referrer
if (!stristr($ref, "$yoursite"))
{
//Offsite referrer detected
  drupal_goto($path = $external, $query = NULL, $fragment = NULL);
}
else {
  drupal_goto($path = $internal, $query = NULL, $fragment = NULL);
}
?>