I've had to pick up a web app built with Drupal - I need to edit a link that is on the front end. It is a single page app - but when I open index.php there is a link to a bootstrap.inc which contains over 11000 lines of code none of which relate to the front end.
-
1Do you mean the link is in the theme?ThatOtherPerson– ThatOtherPerson2011-12-28 10:33:15 +00:00Commented Dec 28, 2011 at 10:33
-
Haha didn;t think of looking in the themes folder, solved the issues now wast in themes/theme-name/templates :)adamhuxtable– adamhuxtable2011-12-28 10:52:43 +00:00Commented Dec 28, 2011 at 10:52
-
There's no actual question here. Are you asking what index.php does? How do edit a link? How bootstrap.inc works?Scott Reynen– Scott Reynen2011-12-28 14:17:13 +00:00Commented Dec 28, 2011 at 14:17
Add a comment
|
2 Answers
In Drupal, index.php is a router. It gets a request from the server, with the path added to it. It then routes the request through many (complex) layers to create the HTML.
I suggest you read up on the basics of Drupal before diving head-first into the application.
Based on your question, you seem to completely misunderstand the basics of Drupals routing, to beging with.
- Request /foo/bar arrives at Apache
- Apache calls `index.php?q=foo/bar
- Drupal gets bootstrapped.
- Drupal loads the menu-system.
- Drupal looks up, if there is a menu-router to handle "foo/bar". Or one of the parents to fall back on ("foo" in this case).
- If found, Drupal will call the callback for that page: for example my_bar.module implements hook_menu and registers "foo/bar" with callback
my_bar_page. This function is available in this module. my_bar_pageis called. Its output should be HTML.- Drupal loads the theme layer, and passes the received HTML as $content into the page template. (amongst others, it also loads the block system, adds footers and does loads of complex preprocessing on all the page variables).
Note that this is a very much simplified version of what actually goes on. The reality is a gigantic (spaggetti, some might say) of callbacks, caching layers, hooks and theme-layers.
1 Comment
Pierre Buyle
See also london2011.drupal.org/conference/sessions/… to understand what's happening and how Drupal handlers a request.