Is it possible to display page before drupal starts. for example displaying a nice jQuery animated page first and then after some time, loading drupal or providing a link to the drupal site on that animated page.


To precisely answer your question, Yes. If a file exists, drupal will not get involved. Therefore, if, for example, you went to www.yourhost.com/splash.php, and splash.php existed in your web root/directory, it would be run without drupal getting involved. In there, if you had a link to www.yourhost.com, where drupal's index.php exists, then upon clicking that link, drupal would bootstrap up and do it's thing.

If this is not what you are asking, you could investigate the Front module that allows you to have different front pages based upon roles. Here, you could, for example, have a fancy splash page for anonymous users that goes away after they login.

If that doesn't work for you, then you could fake this out in a custom module using your own custom logic in either the boot() or init() hooks.

  • Jimajamma what should I do if I want to have page on www.mysite.com (for example a full screen banner) and after clicking on that actual drupal homepage should display – Deepak Aug 20 '12 at 16:43
  • you'd have to create some logic that shows that splash screen once/upon first visiting and then doesn't show it again. this toggle could be a cookie, something in $_SESSION if logged in, etc. – Jimajamma Aug 20 '12 at 16:48
  • drupal.org/project/splash exists, but is for D6 only. there might be some code in there you could use in your own module or maybe there is a D7 module out there as well that does. – Jimajamma Aug 20 '12 at 16:49
  • the Splashify module @kiamlaluno mentions does look to do what you are asking. – Jimajamma Aug 20 '12 at 17:38

Before Drupal bootstraps, it cannot output anything. The only output before Drupal bootstrap can come from a PHP file that doesn't use Drupal, or a simple HTML page that show the jQuery animation.

Serving the initial page from outside Drupal, and then redirecting the user to the Drupal page doesn't give any performance gain, as Drupal is bootstrapped in any case. Drupal would help, for example, when the animation needs to be presented to specific users (e.g. anonymous users, users that log in on Drupal for the first time).

As modules, there is the Splashify module. I have never used it, but from the description, it seems suit your need.

Display a splash page anywhere on your site by redirecting the user, showing a lightbox, or displaying a popup. This module is designed to be search engine friendly, mobile device friendly and offers multiple configuration options.

If there aren't modules that are helpful for you, you can create your own module. I would implement hook_page_alter() to add a JavaScript file to show the animation/popup you need.

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.