By timwhelan on
Okay, The job I got hired at has a third party building out a drupal site. So I am learning many things...
I want to take the theme they created and make a new sub theme or content type from it. By this I mean take the page.tpl.php with the have a header that has a logo and navigation on it & I want a header with logo no navigation for certain pages.
How do I create the page, I figured duplicate the page.tpl.php and use that. But I don't know how to apply it to the new content type. This will be a hidden page, like a landing page for marketing.
If there is a way and I need to read about it please share. Or if there is a method you have seen to do this I would love to read about it.
Thanks
Tim
Comments
=-=
theme guide = http://drupal.org/theme-guide
which includes template suggestions = http://drupal.org/node/190815#template-suggestions
pdf cheatsheet = http://drupal.org/files/issues/Core_templates_and_suggestions.pdf
themeing webcast = http://acquia.com/community/resources/acquia-tv/tips-and-tricks-drupal-t...
you'll want to investigate the devel.module = http://drupal.org/project/devel which aids in making suggestions = http://drupal.org/node/223440
you'll want to use firefox browser with the firebug addon
Thank you very much for this.
Thank you very much for this.
Okay one more question...I
Okay one more question...I didn't find the answer with the above information or didn't figure it out yet with it.
So I have my template for the site. I want to create a hidden page that people can only get to from me giving out the link.
With that in mind I wan a template page for the hidden page that is similar to the main template however with out a few parts. Building the template I am thinking node.landing-page.tpl.php
How do I get the template in the admin side so I can build a page from it?
Thanks
Tim
First create the landing page
First create the landing page using create content, so that its already in your drupal site. To make it hidden, just make sure its not placed into any menu's.
Now get the Devel module very_misunderstood suggested. Enable it and go to your new landing page. Now click the "themer info" button on the bottom of the page, and click your page.
Part of the information devel will give you is this:
Candidate template files:
page-user-29.tpl.php < page-user.tpl.php < page.tpl.php
This will tell you the template files that might be used for your page. In the example above, page.tpl.php will be used if the others aren't present. In other words, drupal will first look for a page-user-29.tpl.php and then move down the list. So what you want to do is open the page.tpl.php that the third party designed, and save a copy as the most specific template that drupal suggests. In the above example it would be page-user-29. Now you can make the changes you want, upload it and your landing page should be themed with it.
- Ryan
Sorry for the Delay, Out for
Sorry for the Delay, Out for Thanksgiving.
Okay Tried what you suggested. Below is the resulting Devel Themer Window.
How do I tell this specific page that I want to use a different Template?
Template called:
page.tpl.php
Candidate template files:
page-node-landing_page.tpl.php < page-node-9027.tpl.php < page-node.tpl.php < page.tpl.php
I want to use page-node-landing_page.tpl.php instead of page.tpl.php.
Thanks!!!
Tim
=-=
Drupal recognizes what tpl.php on it's own more/less in order of operation.
add the .tpl.php file to your theme
clear your cache tables in administer -> performance
test
Okay, I think I am missing
Okay, I think I am missing something.
I don't know how it will automatically see it. That is part of my problem.
I have the file added to my theme in the same location as the page.tpl.php file. The new file is named page-node-landing_page.tpl.php
The page url is tims_landing_page. The content type is called "landing_page", is this how it knows to use the new template file? Do I need to switch the underscore to a dash?
Drupal notices the file but how can I get this specific page to use the one I want?
=-=
if you only want it used on tims_landing_page then you must be more specific and use the suggestion that includes the nid
as it stands page-node-landing_page.tpl.php will be used on every landing page, node-landing_page.tpl.php would be used on every landing_page node.
no you don't alter the suggestions filename with reference to dashes and underscores.