0

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.

3
  • 1
    Do you mean the link is in the theme? Commented 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 :) Commented 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? Commented Dec 28, 2011 at 14:17

2 Answers 2

3

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_page is 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.

Sign up to request clarification or add additional context in comments.

1 Comment

See also london2011.drupal.org/conference/sessions/… to understand what's happening and how Drupal handlers a request.
-1

A link on the front-end would be changed in the theme. There is no need to touch index.php. There are a number of places in the theme where this might be edited. A good place to start looking is /admin/structure/block.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.