Skin Elements
<p>Skin Elements</p>
By Nabeel
Skin Elements:
Between the <title> tags:
<?php echo $page_title ?>
Above the </head> tag:
<?php Template::Show('core_htmlhead.tpl'); ?>
Below the <body> tag:
<?php Template::Show('core_htmlreq.tpl'); ?>
In the navigation:
<?php Template::Show('core_navigation.tpl'); ?>
Layouts
As of 2.1 there is the layout.tpl format. This is the recommended format.
layout.tpl Format
The other alternative is in your skin's folder, creating a file called "layout.tpl", which would contain:
<html> <head> <title><?php echo $page_title ?></title> <?php echo $page_htmlhead; ?> </head> <body> <?php $page_htmlreq; ?> <div id="container"> <div id="content"> <?php echo $page_content; ?> </div> </div> </body> </html>
As you can see, this is the entire HTML page, with several important variables being output:
- <?php echo $page_title ?> - This goes between the title tags
- <?php echo $page_htmlhead;?> - This goes right above the </head> tag
- <?php echo $page_htmlreq; ?> - This goes immediately following the <body> tag
- <?php echo $page_content;?> - This goes where the body of the page (the content) is supposed to show
You can use the Template::Show() calls instead of the above ones, it's the same thing. For an example, view the crystal (the default skin) layout.tpl file. If there is a layout.tpl file, then the header.tpl and footer.tpl files will get ignored.
header.tpl/footer.tpl Format
This is the old, pre2.0 format, which uses two files: header.tpl and footer.tpl - This is when you have something like this:
<html> <head> <title>My Page</title> </head> <body> <div id="container"> <div id="content"> <p>Some content goes here</p> </div> </div> </body> </html>
That will get split into a header and footer file. To find the split - see where content is placed. Anything above where content will be placed, goes into your header.tpl file, and below that into the footer.tpl, like:
header.tpl:
<html> <head> <title><?php echo $page_title ?></title> <?php Template::Show('core_htmlhead.tpl'); ?> </head> <body> <?php Template::Show('core_htmlreq.tpl'); ?> <div id="container"> <div id="content">
footer.tpl:
</div> </div> </body> </html>
Recommended Comments
There are no comments to display.
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.