Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By Drupal-Tech on
Hello..
I want seprate page.tpl for front page in Drupal 7 .. can anybody help me how to do this.?
Comments
=-=
Drupal 6 requires page-front.tpl.php
Drupal 7 requires page--front.tpl.php
note the double hyphen in the D7 requirement.
Thank you!
Looks like a bunch of documentation is still behind on this setting. This worked for me.
=-=
Not sure what you mean with reference to the documentation. D7 template suggestions = http://drupal.org/node/1089656 and there is a double hyphen in the suggestions.
theme cache?
It could be that due to D7s advanced theme registry caching, just making the file (as worked in D6) isn't showing up immediately. Dunno, not tried.
But you should be able to flush the theme cache somehow. visiting admin/build/themes or whatever it's called now may be enough to trigger that. Or maybe there's a button. :-)
.dan. is the New Zealand Drupal Developer working on Government Web Standards
what i have tried.
Thank you VM & dman for your reply
1) I have put page.front.tpl.php in my theme folder where my page.tpl.php is exists.
2) i have cleared all caches from the performance.
3) i have visited theme page. and enable/disabled theme.
but not working.
I have also read documentation of converting theme from 6.x to 7.x but no such help for this.
Still not getting how to do this.. Please help
um, did you try
um, did you try
page-front.tpl.php
as per the docs? That's a dash, not a dot..dan. is the New Zealand Drupal Developer working on Government Web Standards
yes. i have try page-front.tpl.php but not working
my mistake i have put page.front.tpl.php in comment...
It don't work for me too!
Investigate here - > http://drupal.org/node/674784
seems it was changed to page--front.tpl.php but I'm not sure cause I don't test it yet
Thank you danreb & all
Thank you..
i have applied patch http://drupal.org/node/674784#comment-2578696
and used tpl name like page--front.tpl.php
http://drupal.org/update/theme/6/7#template_files_double_hyphen
Hi, I want to get the same
Hi,
I want to get the same thing done but don't know where I need to apply the patch. Please advice.
cheers,
vishal
redcrackle.com
No need to apply the patch.
just use page--front.tpl.php and it will automatically work now.
How to remove some styles and scripts on the head
Hi all, I want my front page only fully customized, therefore would like to remove the following:
misc/jquery.js?v=1.4.4">
jquery.once.js?v=1.2">
drupal.js?lj8myy">
... but on front page only. Is this possible at all? I just found that I could do it completely customized in Drupal 6. Please help how to do this on Drupal 7. Thanks!
if you have tried everything
I tried (1) renaming my file page--front.tpl.php, (2) clearing cache, (3) waiting for several hours, and (4) applying the patch, yet nothing worked. Finally I went to Admin>Configuration>Site Information and even though my default front page already said "node", after I resaved that page Drupal started recognizing my page--front.tpl.php file.
Thanks for posting that ^^^.
Thanks for posting that ^^^. After clearing caches it still did nothing, I had to go to Site Information and save that page for it to start showing up.
thanks
Amazing... this still is necessary transferring from D6 to D7. Would have taken me hours to find it out. Thanks for pointing this out!
Worked for me!
Renaming page-front.tpl.php to page--front.tpl.php worked for me
page--front.tpl.php
Where is this page suppose to be?
sites/all/themes/mayo ?
or
sites/defaults or someplace else
=-=
placed in the theme folder of the active theme. If the active theme maintains tpl.php files in a separate folder inside the theme folder, the page--front.tpl.php can be placed in it.
ensure to clear the theme registry/DB cache after adding new tpl.php files to ensure that they are registered in the DB.
Docs for working with template suggestions = http://drupal.org/node/1089656
drupal 7 front page
subscribing
If page--front.tpl.php
If page--front.tpl.php doesn't work after clearing caches, try to resubmit Site information form with correct homepage alias.
Hi, I have tried the same
Hi,
I have tried the same name as page--front.tpl.php. Its working fine for me. And i tried after removing one hyphen,it is not working because one hyphen supports only in D6 theme.
I think, you need you disable and enable the theme again and then clear the cache.
page--front.tpl.php is Correct
Worked After Clearing Cache in D7
It is a good practice to
It is a good practice to clean cache every time when a template related files are edited.
1.- Create a page--front.php
1.- Create a page--front.php.tpl
2.- Verify that in your template.php exist the next code
3. Clear all caches.
End.
=-=
The above is not required for a page--front.tpl.php file to be recognized by Drupal 7. page--front.tpl.php is a core default template suggestion.
page--front.tpl.php for Bootstrap theme
I am using the theme: https://www.drupal.org/project/bootstrap
I added the file "page--front.tpl.php" at this path : sites\all\themes\bootstrap\theme\system
But this file worked only after i delete the folder "bootstrap_subtheme".
If i need this subtheme also,shall i create the file "page--front.tpl.php" in both the locations? :
sites\all\themes\bootstrap\theme\system
sites\all\themes\bootstrap\bootstrap_subtheme\templates
=-=
The the new tpl.php should only be required in the subtheme folder.