0byt3m1n1
Path:
/
data
/
applications
/
aps.bak
/
coppermine
/
1.5.12-0
/
standard
/
htdocs
/
docs
/
de
/
[
Home
]
File: theme_template.htm
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" dir="ltr"> <head> <title>template.html - Coppermine Photo Gallery - Documentation & Manual</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta name="language" content="en" /> <meta name="copyright" content="Coppermine dev team" /> <meta name="description" content="Coppermine comes with a powerful engine that allows you to create your own theme, giving your gallery a unique look that matches the overall layout of your entire site. To make sure your custom theme does not get overwritten when upgrading, you should start with a custom theme name." /> <meta http-equiv="Content-Style-Type" content="text/css" /> <meta name="MSSmartTagsPreventParsing" content="true" /> <meta http-equiv="imagetoolbar" content="no" /> <meta name="robots" content="noindex" /> <!-- SVN version info: Coppermine version: 1.5.12 $HeadURL: https://coppermine.svn.sourceforge.net/svnroot/coppermine/trunk/cpg1.5.x/docs/de/theme_template.htm $ $Revision: 8154 $ --> <link rel="stylesheet" type="text/css" href="../style/style.css" media="all" /> <link rel="stylesheet" type="text/css" href="../style/screen.css" media="screen" /> <link rel="stylesheet" type="text/css" href="../style/print.css" media="print" /> <link rel="shortcut icon" href="../favicon.ico" /> <script src="../js/jquery.js" type="text/javascript"></script> <script src="../js/jquery.treeview.js" type="text/javascript"></script> <script src="script.js" type="text/javascript"></script> </head> <body> <h1 id="docheader">Coppermine Photo Gallery v1.5.x: Documentation and Manual</h1> <div id="toc"> <a href="toc.htm">Table of Contents</a> </div> <div id="doc_en_only">No translation available</div> <a name="theme_template_html"></a><h1>Editing template.html<a href="#theme_template_html" title="Link to this section"><img src="images/anchor.gif" width="15" height="9" border="0" alt="" /></a></h1> <p>The file template.html is the core file of each theme: it can only contain HTML/CSS/JavaScript code (no PHP!) plus some placeholder tokens that will get replaced with content when the theme is being parsed (i.e. when the HTML output of a gallery page is being generated). Template.html determines the overall layout of your gallery pages. Use it to make your gallery match the overall look of your entire website.</p> <a name="theme_template_token"></a><h2>Template tokens<a href="#theme_template_token" title="Link to this section"><img src="images/anchor.gif" width="15" height="9" border="0" alt="" /></a></h2> <p>When editing the "<strong>template.html</strong>" file do not remove the elements between <strong>{}</strong> - these are the placeholders used by the script. Think of those items in curly brackets as placeholders that will be replaced later with dynamic content when your template is being parsed.<br /> You can move the placeholder tokens around to obtain different layouts. However, there are some limitations - refer to the explanation of the core token <a href="#theme_template_gallery">{GALLERY}</a>, which is not actually a placeholder, but rather a separator between the content served by the pageheader and pagefooter functions.</p> <a name="theme_template_important"></a><h2>Important<a href="#theme_template_important" title="Link to this section"><img src="images/anchor.gif" width="15" height="9" border="0" alt="" /></a></h2> <p>There are some tokens that are optional, i.e. you can safely remove them from template.html if you don't need the feature (s) the placeholders correspond to.</p> <p>Be careful not to delete the <tt class="code">{JAVASCRIPT}</tt>-token - this javascript is necessary for the full-size pop-ups and other functions related to JavaScript. If you remove it, you probably won't notice the difference in the first place, but you definitely mustn't remove it or your gallery will act up.</p> <p>Take a look at the column "Needed?" in the list of tokens in template.html - the ones labelled as "optional" can safely be removed without any issues (except that the corresponding feature will of course not work any longer).<br /> A good example is the token <tt class="code">{GAL_DESCRIPTION}</tt> - it will basically just output whatever you entered as gallery description on the config page. If you don't need the description to show on each and every coppermine-driven page, then just remove the corresponding token from template.html.</p> <a name="theme_template_token_list"></a><h2>List of tokens in template.html<a href="#theme_template_token_list" title="Link to this section"><img src="images/anchor.gif" width="15" height="9" border="0" alt="" /></a></h2> <table border="0" cellspacing="0" cellpadding="0" class="cpg_zebra"> <tr> <th valign="top" align="left">Token</th> <th valign="top" align="left">Description</th> <th valign="top" align="left">Default position</th> <th valign="top" align="left">Needed?</th> <th valign="top" align="left">Dependancies</th> </tr> <tr> <td valign="top"><a name="theme_template_lang_dir"></a>{LANG_DIR}<a href="#theme_template_lang_dir" title="Link to this section"><img src="images/anchor.gif" width="15" height="9" border="0" alt="" /></a></td> <td valign="top"> <strong>Language direction</strong><br /> Possible values are <abbr title="left-to-right">LTR</abbr> and <abbr title="right-to-left">RTL</abbr>. Should not be changed or modified at all. </td> <td valign="top">pageheader</td> <td valign="top">mandatory</td> <td valign="top">Filled by Coppermine, depending on the orientation of the language the end user has chosen</td> </tr> <tr> <td valign="top"><a name="theme_template_charset"></a>{CHARSET}<a href="#theme_template_charset" title="Link to this section"><img src="images/anchor.gif" width="15" height="9" border="0" alt="" /></a></td> <td valign="top"> <strong>Character set</strong><br /> Determines the character set used - filling the HTML tag <tt class="code"><meta http-equiv="Content-Type" content="text/html; charset={CHARSET}" /></tt>. Do not change unless you <em>really</em> know what you're doing. </td> <td valign="top">pageheader</td> <td valign="top">mandatory</td> <td valign="top">Filled by Coppermine, depending on the <a href="configuration.htm#admin_language_charset">encoding</a> the admin has chosen in config.</td> </tr> <tr> <td valign="top"><a name="theme_template_title"></a>{TITLE}<a href="#theme_template_title" title="Link to this section"><img src="images/anchor.gif" width="15" height="9" border="0" alt="" /></a></td> <td valign="top"> <strong>Page Title</strong><br /> The page title that is mainly taken into account by search engines. The human visitor sees the title tag in the browser window. </td> <td valign="top">pageheader</td> <td valign="top">mandatory</td> <td valign="top">Title tag is being composed in the individual coppermine core file (e.g. displayimage.php, thumbnails.php etc.), handed over to the pageheader function.</td> </tr> <tr> <td valign="top"><a name="theme_template_meta"></a>{META}<a href="#theme_template_meta" title="Link to this section"><img src="images/anchor.gif" width="15" height="9" border="0" alt="" /></a></td> <td valign="top"> <strong>Meta tags</strong><br /> Meta tags that depend on the dynamic content of a page are being inserted here. Currently, Coppermine uses the keywords meta tag (<tt class="code"><meta name="keywords" content="DYNAMIC CONTENT HERE" /></tt>) and the refresh meta tag (<tt class="code"><meta http-equiv="refresh" content="5; URL=REDIRECTION_PAGE" /></tt>).<br /> If you want to add other meta tags (e.g. author meta data like <tt class="code"><meta name="author" content="Firstname Lastname" /></tt>), do not replace the token, but add your custom meta tags below the {META}-token. </td> <td valign="top">pageheader</td> <td valign="top">mandatory</td> <td valign="top">Populated dynamically by the script, e.g. for meta keywords based on file keywords or for redirection for status change screens.</td> </tr> <tr> <td valign="top"><a name="theme_template_javascript"></a>{JAVASCRIPT}<a href="#theme_template_javascript" title="Link to this section"><img src="images/anchor.gif" width="15" height="9" border="0" alt="" /></a></td> <td valign="top"> <strong>JavaScript</strong><br /> This token has been added in cpg1.5.x It will be replaced with <tt class="code"><script type="text/javascript" src="scripts.js"></script></tt> (which is mandatory to have for Coppermine to work properly). You mustn't remove this tag, but you can add your custom JavaScript code beneath it (in a new line). </td> <td valign="top">pageheader</td> <td valign="top">mandatory</td> <td valign="top"><abbr title="not applicable">n/a</abbr></td> </tr> <tr> <td valign="top"><a name="theme_template_custom_header"></a>{CUSTOM_HEADER}<a href="#theme_template_custom_header" title="Link to this section"><img src="images/anchor.gif" width="15" height="9" border="0" alt="" /></a></td> <td valign="top"> <strong>Custom Header</strong><br /> If the corresponding option has been set in config, this token will be replaced with the output that your <a href="php-content.htm#php-content_header_footer">custom header</a> generates. If you don't use the custom header feature, you can remove the {CUSTOM_HEADER}-token from your template, but it's advisable to leave it in place if you decide to use the feature later. </td> <td valign="top">pageheader</td> <td valign="top">optional</td> <td valign="top"><a href="configuration.htm#admin_theme_custom_header_path_start">Path to custom header include</a> set up in config</td> </tr> <tr> <td valign="top"><a name="theme_template_gal_name"></a>{GAL_NAME}<a href="#theme_template_gal_name" title="Link to this section"><img src="images/anchor.gif" width="15" height="9" border="0" alt="" /></a></td> <td valign="top"> <strong>Gallery name</strong><br /> Will be replaced with the gallery name you set up in config when the template is being parsed. You might want to remove this token, especially if you already have a banner in your theme that displays your gallery name. </td> <td valign="top">pageheader</td> <td valign="top">optional</td> <td valign="top"><a href="configuration.htm#admin_general_name">Gallery name</a> set in config</td> </tr> <tr> <td valign="top"><a name="theme_template_gal_description"></a>{GAL_DESCRIPTION}<a href="#theme_template_gal_description" title="Link to this section"><img src="images/anchor.gif" width="15" height="9" border="0" alt="" /></a></td> <td valign="top"> <strong>Gallery description</strong><br /> Will be replaced with the gallery description you set up in config when the template is being parsed. You might want to remove this token, especially if you already have a banner in your theme that displays your gallery name. </td> <td valign="top">pageheader</td> <td valign="top">optional</td> <td valign="top"><a href="configuration.htm#admin_general_description">Gallery description</a> set in config</td> </tr> <tr> <td valign="top"><a name="theme_template_sys_menu"></a>{SYS_MENU}<a href="#theme_template_sys_menu" title="Link to this section"><img src="images/anchor.gif" width="15" height="9" border="0" alt="" /></a></td> <td valign="top"> <strong>System menu</strong><br /> Determines the position of the first level menu the end user will see on your page (the one that contains the login/logout link). Even if you want to get rid of the menu or parts of it, do not remove the {SYS_MENU} token itself, but remove the menu items you don't want displayed by editing theme.php instead. </td> <td valign="top">pageheader</td> <td valign="top">mandatory</td> <td valign="top"> <ul> <li>Login/Logout link: Status of user (admin/registered user/guest).</li> <li>Upload-link: Permission of current user to upload (determined in <a href="groups.htm#group_cp">groups panel</a>).</li> <li>Register-link: <a href="configuration.htm#admin_allow_registration">Allow new user registrations</a> enabled/disabled in config.</li> <li>FAQ-link: <a href="configuration.htm#admin_theme_faq">Display FAQ</a> enabled/disabled in config.</li> </ul> </td> </tr> <tr> <td valign="top"><a name="theme_template_sub_menu"></a>{SUB_MENU}<a href="#theme_template_sub_menu" title="Link to this section"><img src="images/anchor.gif" width="15" height="9" border="0" alt="" /></a></td> <td valign="top"> <strong>Sub menu</strong><br /> Determines the position of the second level menu the end user will see on your page (the one that contains the links "Album list" / "Last uploads" / "Last comments" / "Most viewed" / "Top rated" / "My Favorites" / "By Date" / "Search"). Even if you want to get rid of the menu or parts of it, do not remove the {SUB_MENU} token itself, but remove the menu items you don't want displayed by editing theme.php instead. </td> <td valign="top">pageheader</td> <td valign="top">mandatory</td> <td valign="top"><abbr title="not applicable">n/a</abbr></td> </tr> <tr> <td valign="top"><a name="theme_template_language_select_flags"></a>{LANGUAGE_SELECT_FLAGS}<a href="#theme_template_language_select_flags" title="Link to this section"><img src="images/anchor.gif" width="15" height="9" border="0" alt="" /></a></td> <td valign="top"> <strong>Language selector (flags)</strong><br /> Will display a row of flags representing the <a href="languages.htm">languages</a> available for the end user to choose.<br /> The language selector list will look like this:<br /> <div class="cpg_example">Choose your language: <a href="#"><img src="../../images/flags/cn.png" border="0" width="16" height="11" alt="" title="Chinese simplified / 中文 - 简体" /></a> <a href="#"><img src="../../images/flags/us.png" border="0" width="16" height="11" alt="" title="English (US)" /></a> <a href="#"><img src="../../images/flags/fr.png" border="0" width="16" height="11" alt="" title="French / Français" /></a> <a href="#"><img src="../../images/flags/de.png" border="0" width="16" height="11" alt="" title="German (informal) / Deutsch (Du)" /></a> <a href="#"><img src="../../images/flags/lu.png" border="0" width="16" height="11" alt="" title="Luxembourgish / Lëtzebuergesch" /></a> <a href="#"><img src="../../images/flags/reset.png" border="0" width="16" height="11" alt="" title="Default language" /></a> </div> Of course (unilke this example) it will actually do something when a new selection is made: the gallery language will change. <div class="cpg_message_info"> Back in cpg1.4.x, the token used to reside in all themes that came with coppermine out of the box and there used to be an option in coppermine's config to determine wether you wanted the language selector to appear or not. With cpg1.5.x the selector has been dropped from the themes and the option from the config panel, so you explicitely have to add the token to your template.html file to see the selector. By default, Coppermine does <em>not</em> display the language selector. The reason for the decision of the coppermine dev team to drop the selector out of the box is the fact that Coppermine's built-in mechanisms to detect a visitor's prefered <a href="languages.htm#how">language</a> works so well that there is hardly ever a need to offer a language selector to your visitors. Only in the rare cases when you're convinced that your visitor's browser language probably is not the language they would prefer to see your gallery in should you provide a language selector. </div> <div class="cpg_example">This is for example the case for Luxembourg: the Grand Duchy of Luxembourg is a small country in Europe with three official languages: <ul> <li>French</li> <li>German</li> <li>Luxembourgish</li> </ul> With less then half a million inhabitants (and probably far less people actuall speaking Luxembourgish each day) the major browser creators don't provide a browser with Luxembourgish as prefered language. Subsequently, if your gallery catters for a Luxembourgian audience, it might make sense to add a language selector by editing <tt class="code">themes/yourtheme/template.html</tt> and adding somewhere (preferably near the top of the screen) that allows your visitors to actually see the gallery's navigation in Luxembourgish (provided that there is a language file in Luxembourgish of course).</div> </td> <td valign="top">none</td> <td valign="top">optional</td> <td valign="top">-</td> </tr> <tr> <td valign="top"><a name="theme_template_language_select_list"></a>{LANGUAGE_SELECT_LIST}<a href="#theme_template_language_select_list" title="Link to this section"><img src="images/anchor.gif" width="15" height="9" border="0" alt="" /></a></td> <td valign="top"> <strong>Language selector (list)</strong><br /> Will display a dropdown list of <a href="languages.htm">languages</a> available for the end user to choose.<br /> The language selector list will look like this: <div class="cpg_example"> <select name="cpgLanguageSelect"> <option value="bulgarian" >Bulgarian (Български)</option> <option value="chinese_gb" >Chinese simplified (中文 - 简体)</option> <option value="english" selected="selected">English (US)</option> <option value="english_gb" >English (British)</option> <option value="finnish" >Finnish (Suomea)</option> <option value="french" >French (Français)</option> <option value="german">German (Deutsch)</option> <option value="greek" >Greek (Ελληνικά)</option> <option value="polish" >Polish (Polski)</option> <option value="russian" >Russian (Русский)</option> </select> </div> Of course (unilke this example) it will actually do something when a new selection is made: the gallery language will change. <div class="cpg_message_info">It's merely a matter of taste if you use the language selector with flags or the one that displays a dropdown list of available languages, so basically what has been said above about <a href="#theme_template_language_select_flags">{LANGUAGE_SELECT_FLAGS}</a> applies to {LANGUAGE_SELECT_LIST} as well.</div> </td> <td valign="top">none</td> <td valign="top">optional</td> <td valign="top"></td> </tr> <tr> <td valign="top"><a name="theme_template_theme_select_list"></a>{THEME_SELECT_LIST}<a href="#theme_template_theme_select_list" title="Link to this section"><img src="images/anchor.gif" width="15" height="9" border="0" alt="" /></a></td> <td valign="top"> <strong>Theme selector (list)</strong><br /> Will display a dropdown list of themes available for the end user to choose. </td> <td valign="top">none</td> <td valign="top">optional</td> <td valign="top"></td> </tr> <tr> <td valign="top"><a name="theme_template_admin_menu"></a>{ADMIN_MENU}<a href="#theme_template_admin_menu" title="Link to this section"><img src="images/anchor.gif" width="15" height="9" border="0" alt="" /></a></td> <td valign="top"> <strong>Admin menu</strong><br /> Displays the <a href="admin_menu.htm">admin menu</a>. </td> <td valign="top">pageheader</td> <td valign="top">mandatory</td> <td valign="top">Admin must be logged in. <a href="admin_menu.htm#admin_user_mode">Admin controls</a> mustn't be hidden.</td> </tr> <tr> <td valign="top"><a name="theme_template_message_block"></a>{MESSAGE_BLOCK}<a href="#theme_template_message_block" title="Link to this section"><img src="images/anchor.gif" width="15" height="9" border="0" alt="" /></a></td> <td valign="top"> <strong>Message block</strong><br /> </td> <td valign="top">pageheader</td> <td valign="top">mandatory</td> <td valign="top"></td> </tr> <tr> <td valign="top"><a name="theme_template_gallery"></a>{GALLERY}<a href="#theme_template_gallery" title="Link to this section"><img src="images/anchor.gif" width="15" height="9" border="0" alt="" /></a></td> <td valign="top"> <strong>Gallery</strong><br /> Special token that will later be replaced with the actual Coppermine output. In the above introduction to the template tokens we said that you can move around the tokens inside the template.html file.<br /> However, you have to understand that the {GALLERY}-token is a special placeholder: think of it more as a separator than an actual placeholder token. When the template is being parsed, the {GALLERY}-token will be replaced with the actual core component of the gallery. Other placeholders tokens in curly braces that come <em>before</em> the {GALLERY} token are being handled by the <a href="#theme_create_theme_pageheader">pageheader function</a>; placeholder tokens that come <em>after</em> the {GALLERY}-token are being handled by the <a href="#theme_create_theme_pagefooter">pagefooter function</a>. Therefore, you have to keep in mind that you can freely move tokens around in template.html as long as you don't reverse the position of the token you move and the {GALLERY}-token. </td> <td valign="top"><abbr title="not applicable">n/a</abbr></td> <td valign="top">mandatory</td> <td valign="top"></td> </tr> <tr> <td valign="top"><a name="theme_template_custom_footer"></a>{CUSTOM_FOOTER}<a href="#theme_template_custom_footer" title="Link to this section"><img src="images/anchor.gif" width="15" height="9" border="0" alt="" /></a></td> <td valign="top"> <strong>Custom Footer</strong><br /> If the corresponding option has been set in config, this token will be replaced with the output that your <a href="php-content.htm#php-content_header_footer">custom footer</a> generates. If you don't use the custom footer feature, you can remove the {CUSTOM_FOOTER}-token from your template, but it's advisable to leave it in place if you decide to use the feature later. </td> <td valign="top">pagefooter</td> <td valign="top">optional</td> <td valign="top"><a href="configuration.htm#admin_theme_custom_footer_path_start">Path to custom footer include</a> set up in config</td> </tr> <tr> <td valign="top"><a name="theme_template_vanity"></a>{VANITY}<a href="#theme_template_vanity" title="Link to this section"><img src="images/anchor.gif" width="15" height="9" border="0" alt="" /></a></td> <td valign="top"> <strong>Vanity block</strong><br /> If your custom theme is valid, the {VANITY}-placeholder will be replaced with mini-banners that link to PHP.net, mysql.com and the HTML and CSS validators of the W3C.<br /> <img src="../images/vanity.png" width="351" height="26" border="0" alt="" title="vanity block" /> </td> <td valign="top">pagefooter</td> <td valign="top">optional</td> <td valign="top"> none </td> </tr> <tr> <td valign="top"><a name="theme_template_credits"></a>{CREDITS}<a href="#theme_template_credits" title="Link to this section"><img src="images/anchor.gif" width="15" height="9" border="0" alt="" /></a></td> <td valign="top"> <strong>Credits</strong><br /> Will display the "Powered by Coppermine" tag on your page. If the token is being removed, the copyright-disclaimer will be displayed as part of the {GALLERY}-block. If you want to edit (or even delete) the "Powered by Coppermine" tag, read <a href="theme_copyright.htm">Copyright-disclaimer in footer</a> </td> <td valign="top">pagefooter</td> <td valign="top">optional</td> <td valign="top">Credits section defined in theme.php</td> </tr> </table> <div id="doc_footer"> <div class="doc_info_wrapper"> <span id="doc_last_changed">$LastChangedDate: 2011-01-02 20:44:22 +0100 (So, 02 Jan 2011) $</span> <span id="doc_revision">$Revision: 8154 $</span> </div> </div> </body> </html>