Sign up ×
Drupal Answers is a question and answer site for Drupal developers and administrators. It's 100% free, no registration required.

Possible Duplicate:
Path (URL) to call custom module function

I would like to create specific page that will be shown only on specific url (for example, specific extended search page).

That page would reside, for example, in my template folder, and would trigger only when the url is visited.

That specific page is not part of any content type, but it is simmilar to view (but i do not want to use views). I would like to write all presentation and logic myself in that page, and would like that page to inherit theme wrapper (like it is a node).

For example, user visits And then my custom page search.php in template folder is "triggered"

Please advise what would be good way to achieve this.

share|improve this question

marked as duplicate by Clive, Chapabu, Anil Sagar, googletorp Oct 31 '12 at 11:18

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

1 Answer 1

up vote 1 down vote accepted

To create a page by code you should:

  • create a custom module
  • use hook_menu to create the path of the page
  • use the page_callback option of hook_menu to create the function that returns the html for the page
share|improve this answer
Thanks, i was "afraid" that this is the answer. There is a quick "workaround" : crate page in template folder, look for a path inside page.tpl.php, if you are on a given path, include php, exclude content ;D –  NenadP Oct 5 '12 at 7:07
very manually workaround :D Another solution is Panels, if you want to use it –  arrubiu Oct 5 '12 at 7:12
nonono, i gave up with panels long ago :) –  NenadP Oct 5 '12 at 7:29

Not the answer you're looking for? Browse other questions tagged or ask your own question.