Creating a custom contact page -- page-contact.tpl.php
I'm new to Drupal. I want to create a contact page, so I copied page.tpl.php and开发者_JS百科 renamed it to page-contact.tpl.php. I created some new elements in the page, so I can see that if I click on the "contact" link, I'll know that I went to the correct page.
Right now I don't see any change. Was there something I missed? Do I need to do something in the admin settings so Drupal knows which file I need to open?
I also tried clearing my cache.
In theory, this is a valid approach. Problem is, you'll be able to create a new layout for your contact page this way, but not necessarily change the contact form. If you wish to alter the form as well, I'd recommend using the webform
module. It's pretty flexible when it comes to creating contact forms, plus, it creates a node, so you can style it with ease (either in you standard node.tpl.php
or - even better - in node-webform.tpl.php
). This is what I usually do.
There might be other solutions too, but it would help if you made it clear what kind of alterations you wish to introduce in your contact page.
When you say cleared my cache
do you mean the browser cache or drupal's cache? Ensure drupal's theme registry has been cleared by going to /admin/build/themes
, or logging out and back in.
I also recommend trying the webform module as mingos suggests.
Drupal core's built in contact module does not use any templates, so you'll have to use something like Webform if you want a per-contact template.
精彩评论