Theme consists of the following folders and files
/templates -- templates for page's generation navigation.tset.phtml -- template for menu index.tset.phtml -- template for index message.tpl.phtml -- template for system's messages master_layout.tpl.phtml -- header for all templates, contains head section, common for all html files html_layout.tpl.phtml -- template for standard view in html singlepage_content.tpl.phtml -- template for page inside the single html-file singlepage_layout.tpl.phtml -- template for single html file chm_layout.tpl.phtml -- template for CHM output /web -- images, icons, css, javasript
Template is an HTML text with special variables like:
<?php echo $content; ?>
The following variables are available in templates master_layout.tpl.phtml, html_layout.tpl.phtml, singlepage_content.tpl.phtml, chm_layout.tpl.phtml:
There is special template for this output, — singlepage_layout.tpl.phtml. The following variables are available:
Another template, you need is master_layout.tpl.phtml, where the following variables could be used:
Navigation's template is located in navigation.tset.phtml file, and is sectioned template. System calls sections while building menu's fragments. Example template:
<!-- #menu_topic# --> <li><a href='<?php echo $href ?>'><?php echo $title; ?></a></li> <!-- #active_menu_topic# --> <li class='active'><?php echo $title ?></li> <!-- #toc_topic# --> <div style='margin-top: 7px;margin-left: <?php echo 20*$level; ?>px'> <a href='<?php echo $href ?>'><?php echo $title; ?></a> </div> <!-- #toc# --> <div style='margin-top: 0px;margin-left: 40px'><?php echo $content; ?></div>
Variable outputMode (html, html_single, chm) is available from any section.
In menu topic's and TOC topic's sections (menu_topic, active_menu_topic, toc_topic) variables link ($href) and menu topic's title ($title) are available. In the TOC section (toc) the TOC's content is contained in $content variable.
The template is located in index.tset.phtml and looks like the following:
<!-- #indexTopic# --> <p style='margin: 0'> <?php echo $word; ?> <span style='font-size: x-small'> <?php foreach ($pages as $page): ?> [<?php echo "<a href='$rootPath{$page['path']}'>".$page['title']."</a>" ?>] <?php endforeach; ?> </span> </p> <!-- #indexSection# --> <div style="margin-top: 30px"> <p style="font-weight: bold;margin-bottom: 5px"><?php echo strtoupper($curLetter); ?></p> <?php echo $buffer; ?> </div>
As usual outputMode variable (html, html_single, chm) could be accessed from all sections
In indexTopic section one can use variables:
In indexSection part $curLetter (The first letter of the words is currently grouped) and $buffer, which contains block of words, grouped by the first letter
This template is for displaying messages like "index is successfully rebuilt" with "Back" button. The following variables are available:
If you're plan to use your theme with both singe and multibyte encodings use special string functions instead of standard ones:
//to lower case function colesoStrToLower($str); //to upper case function colesoStrToUpper($str); //substring, //if length==null, then substring to the end of original string //will be obtained function colesoSubstr($str, $start,$length=null);
© H-type, 2008
www.bulldoc.ru