Knightnet Site Design - Template Examples, how to use the templates |
|
Example 1 - Short example with "manual" contentIt doesn't get any simpler than this! The content here is "manual" because you leave PHP and simply write some HTML, the template wraps the important structures around this. Most pages on the Knightnet web site are like this. The output produced includes the standard headings, footings, breadcrumb and left navigation menus as shown on this page.
Example 2 - Short example using the content variableAlso very simple. The content here is assigned to a standard variable for output. This is most useful where you want PHP to do something with the string.
Example 3 - The shortest example (content provided by external file)OK, I lied in example 1 as this is simpler still! Here the content comes from an external file. You can override the default file name using "$Template->setVar('incFile',array('file1.inc','file2.inc'))" so you can see that several files can be included.
Combining contentThese three methods of providing content can even be combined. The order of output is:
Example 4 - Search engine friendlyOK, you've seen the really simple stuff. That is useful as it is - but it gets even better. The template is designed to automatically help search engine placement. Simply include a title and, optionally, a description. The title is repeated on the page as an <h1>. All you need to do is then make sure that the content is relevant to the title.
In addition, the automenu to the left is actually AFTER the main content which helps with text only or otherwise limited browsers (e.g. hand-held computers) and ensures that the content gets the weighting it deserves when the search robots index it. These are very simple search engine optimisations but they really do work. What's more, they work without compromising the content or the human friendly layout of the page. | |
![]() ![]() |
Page: Updated 2008-07-10 08:50:07, Author Julian Knight, Version 2.0 |