By lsolesen on
I found out how to choose which page to use as a frontpage on admin/config/system/site-information. However, I want the frontpage to be special layout. How do I use a special layout for exactly the page I choose to be my frontpage? Thank you in advance!
Comments
Make a page-front.tpl.php.
Make a page-front.tpl.php. Have you read the theming guide?
works at bekandloz | plays at technonaturalist
I have created
I have created page-front.tpl.php. But the only way I can get it to show is:
But I must be doing something wrong then?
Yeahh.. it works..
thank you.. it's works fine to me.. :)
I have read the theming guide
I have read the theming guide - will reread it :) I have done the following:
- created page-front.tpl.php
- I chose one specific node to be the front page
But it is just using page.tpl.php, not page-front.tpl.php. Maybe I am missing something?
Drupal 7: page--front.tpl.php
Turned out that in Drupal 7, you need to use page--front.tpl.php. I also tried to edit another content type, but there I could not get page--subject.tpl.php to work. I had to use node--subject.tpl.php.
I am so sorry for appearing
I am so sorry for appearing to abandon you, I find it hard to get on the forums every day. Am glad you worked it out, and sorry for inadvertantly leading you astray with the page--front.tpl.php, probably a combo of habit from D6 and dodgy keyboard :)
Pages are templates for the entire document layout, nodes are to lay out just the content type. Structure wise it goes:
html.tpl.php (contains your doctype, head and opening and closing body tags as well as some code for running and exiting scripts, I also put skipnav up here)
- page.tpl.php | page--type.tpl.php (included by html.tpl.php, layout for the site, use page--type if you want a page like the front to look different)
-- node.tpl.php | node--type.tpl.php (included by page.tpl.php, lays out the content types you make)
Just in the unlikely event you didn't already find it while trawling the docs :)
works at bekandloz | plays at technonaturalist
Thanks for taking your time
Thanks for taking your time to reply :) I am getting the hang of Drupal.
yes using double dash in file
yes using double dash in file name does the trick for me.
So that means in order to override front page template in drupal 7 one needs to use page--front.tpl.php as template or file name.
where as in drupal 6 one need to use page-front.tpl.php as template or file name.
Front Page
There's also the Front Page module:
http://drupal.org/project/front
[edit: ah, I see you say 7]
i have created a theme and
i have created a theme and made the following files:-
1.html.tpl.php
2.page.tpl.php
3.page--front.tpl.php
then i have run the home page such as http://www.example.com/, then it calls html.tpl.php page, but it does not call "page--front.tpl.php" nor the "page.tpl.php" page.
So how can i make call the "page--front.tpl.php" page to make a different template page for home page at drupal 7?
Stupid questions: you
Stupid questions:
If you add extra tpls you usually have to clear the cache for Drupal to notice them.
works at bekandloz | plays at technonaturalist
Another way to create front page
goto admin/content than
+Add content -> Basic page (create a basic page)
give title and content of that page
in URL path settings set URL alias like front-page
than save.
Now drupal created a page with some title and content and url is yoursitename/front-page
Now go to configuration->site information->FRONT PAGE->Default front page
in text box enter the url alias of your front page for eg. front-page
and Save configuration
Now its your front page ready!