THE TEMPLATING SYSTEM~~~~~~~~~~~~~~~~~~~~~Everyone wants their view onto their SVN repository to fit in with their lookand feel. With WebSVN's templating system this is very possible.To create your own templates, you first need to change your config.inc file totell WebSVN where the templates are stored. For example:$config->setTemplatePath("./templates/Standard/");This directory should contain at least the following files:header.tmpl - Header templated included before any otherfooter.tmpl - Footer templated included after any otherindex.tmpl - The main project page templatedirectory.tmpl - Listing of a directorylog.tmple - Log of a directory or filefile.tmpl - Contents of a text filediff.tmpl - Differences between text filesblame.tmpl - Blame information for a fileEach template file should be written in HTML, but is allowed to contain certainWebSVN controls. There are two control types, commands and variables.COMMANDS~~~~~~~~NOTE: Commands MUST appear on their own line.---[websvn-test:varname]...[websvn-else]...[websvn-endtest]If the variable is non-0 write out the first part else write out the second---[websvn-startlisting]...[websvn-endlisting]Used in pages that contain listings of files, logs, etc. Everything betweenthe controls is repeated for each item in the list---[websvn-defineicons] (used in directory.tmpl only)...[websvn-enddefineicons]...[websvn-treenode][websvn-icon]These commands are used to display certain icons next to certain file types inthe directory view.The [websvn-defineicons] block should contain a line for each file type,defining the HTML to be used for that file type. To define the HTML for aparticular extension use the syntax:.<extension>=<HTML code>There are also some special filetypes:dir=<HTML code> is used for directory iconsdiropen=<HTML code> is used for open directory icons*=<HTML code> is used for all filetypes which have no other definitioni-node - | shaped node of the tree viewt-node - T shaped node of the tree viewl-node - L shaped node of the tree viewe-node - Empty node of the tree viewExample from the BlueGrey scheme:[websvn-defineicons]dir=<img align="middle" valign="center" src="[websvn:locwebsvnhttp]/templates/BlueGrey/folder.png" alt="[FOLDER]">diropen=<img align="middle" valign="center" src="[websvn:locwebsvnhttp]/templates/BlueGrey/folder-open.png" alt="[FOLDER]">*=<img align="middle" src="[websvn:locwebsvnhttp]/templates/BlueGrey/file.png" alt="[FILE]">.c=<img align="middle" src="[websvn:locwebsvnhttp]/templates/BlueGrey/filec.png" alt="[C-FILE]">.h=<img align="middle" src="[websvn:locwebsvnhttp]/templates/BlueGrey/fileh.png" alt="[H-FILE]">.s=<img align="middle" src="[websvn:locwebsvnhttp]/templates/BlueGrey/files.png" alt="[S-FILE]">i-node=<img align="middle" border="0" width="24" height="26" src="[websvn:locwebsvnhttp]/templates/BlueGrey/i-node.png" alt="[NODE]">t-node=<img align="middle" border="0" width="24" height="26" src="[websvn:locwebsvnhttp]/templates/BlueGrey/t-node.png" alt="[NODE]">l-node=<img align="middle" border="0" width="24" height="26" src="[websvn:locwebsvnhttp]/templates/BlueGrey/l-node.png" alt="[NODE]">e-node=<img align="middle" border="0" width="24" height="26" src="[websvn:locwebsvnhttp]/templates/BlueGrey/e-node.png" alt="[NODE]">[websvn-enddefineicons]Inside the [websvn-startlisting] block, the command [websvn-treeview] willoutput the HTML code defined for the appropriate tree view icon.[websvn-icon] will output the HTML code defined for the type of the currentfile.---[websvn-getlisting] (used in file.tmpl only)Get the contents of the file being viewed and output it exactly (surroundedwith <PRE> .. </PRE>).VARIABLES~~~~~~~~~Variables are written in the form [websvn:varname] where varname is the name ofa variable passed to the template. The control is replaced with the variablerequired.The variables available are described below for each template.You may also access the language file using [lang:varname] is order to keep yourtemplates international!Take special notice of the use of the locwebsvnhttp variable. It should be usedto locate other files and graphics that your templates need. For example:<link href="[websvn:locwebsvnhttp]/templates/tmptname/styles.css" ...You may imagine that simply using . in place should work, however this isn'tthe case when MultiViews are turned on. Using this variable gives you a way toaccess your template files in all cases.Variables defined for in all scripts~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~locwebsvnhttp - Root of websvn directorycharset - The charset requested by the userprojects_form - HTML <form> specification for the projects selection boxprojects_select - HTML <select>...</select> specification for the projectoptionsprojects_submit - HTML <input> specification for the projects selection GObuttonprojects_endform - HTML </form> specification for the projects selectionbox (includes hidden field declarations)lang_form - HTML <form> specification for the language selection boxlang_select - HTML <select>...</select> specification for the language optionslang_submit - HTML <input> specification for the language selection GO buttonlang_endform - HTML </form> specification for the language selection boxnoaccess - True if the user should be blocked from accessing this page dueto insufficient access rights.Variables defined for index.tmpl~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~treeview - true if the index should be displayed as a tree of grouped projectsflatview - true if the index should be displayed as a simple list of projectsopentree - true if the tree viewed should be open by defaultUsed in [websvn-startlisting] ... [websvn-endlisting] block of a flat view:projlink - Link to the projectrowparity - Parity of the row (0 or 1). Used to generate striped tablesUsed in [websvn-startlisting] ... [websvn-endlisting] block of a tree view:isprojlink - This item is a project linkisgrouphead - This item is a group namerowparity - Parity of the row (0 or 1). Used to generate striped tableslistitem - The item to displayVariables defined for directory.tmpl~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~restricted - True if the users has restricted access to this directory (toallow access to a readable directory lower down only)repname - Name of the repositoryrev - Revision being viewedpath - Path of item being loggedauthor - Author of current revisiondate - Date that revision was committedlog - Log message of revisionlastchangedrev - Revision of the last modification to current directorygoyoungestlink - Link to head revision of repositoryshowchanges - 1 if showing changes (for websvn-test)hidechanges - 1 if hiding changes (for websvn-test)showchangeslink - Link to page with changes hiddenhidechangeslink - Link to page with changes shownnewfilesbr - list of the new files separated by <BR>'schangedfilesbr - list of the changed files separated by <BR>'sdeletedfilesbr - list of the deleted files separated by <BR>'snewfiles - list of the new files separated by spaceschangedfiles - list of the changed files separated by spacesdeletedfiles - list of the deleted files separated by spacescurdirlinks - List of the path of this directory with links to each onecurdirloglink - Link to the log view of current directorycurdirrsslink - Link to the RSS feed for the current directorycurdirrssanchor - The <a href=...> tag to the RSS feed for the current directorycurdirrsshref - URL of the feed for the current directory (without anchor tag)curdirdllink - Link to the tarball of current directorycurdircomplink - Link to comparison with previously changed revisionallowdownload - True if downloading has been configuredcompare_form - HTML <form> specification for the comparison formcompare_submit - HTML <input> specification for the comparison buttoncompare_endform - HTML </form> specification for the comparison formUsed in [websvn-startlisting] ... [websvn-endlisting] block:compare_box - HTML checkbox specification for the comparison optionfilelink - Link to the filerowparity - Parity of the row (0 or 1). Used to generate striped tablesfileviewloglink - Link to the log page for the filefileviewdllink - Link to the tarball of current directoryisDir - true if the current file is a directory (use with [websvn-test:isDir]to display icons)rsslink - Link to the RSS feed for this file/directoryrssanchor - The <a href=...> tag to the RSS feed for this file/directoryVariables defined for log.tmpl~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~action - Action being performed ("Log")repname - Name of the repositoryrev - Revision being viewedpath - Path of item being loggedcurdirlinks - List of the path of this directory with links to each oneerror - Error message when results not availablepagelinks - List of list to all the pages of the logshowalllink - Link to show the entire log in one gologsearch_form - HTML <form> specification for the log search boxlogsearch_inputbox - HTML <input> specification for the log search boxlogsearch_submit - HTML <input> specification for the log search GO buttonlogsearch_endform - HTML </form> specification for the log search box box(includes hidden field declarations)logsearch_clearloglink - Link to unfiltered display (remove current searchcriteria)logsearch_resultsfound - true when there are logs to displaylogsearch_nomatches - true when there are no matches for the current requestlogsearch_nomorematches - true when there are no further matches to the currentrequest (but there have been previous pages,for example)compare_form - HTML <form> specification for the comparison formcompare_submit - HTML <input> specification for the comparison buttoncompare_endform - HTML </form> specification for the comparison formUsed in [websvn-startlisting] ... [websvn-endlisting] block:compare_box - HTML checkbox specification for the comparison optionrevpathlink - Link to revisionrevauthor - Author of this revisionrevage - Age of revisionrevlog - Log message of revisionVariables defined for file.tmpl~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~repname - Name of the repositoryrev - Revision being viewedpath - Path of item being loggedcurdirlinks - List of the path of this directory with links to each oneprevdifflink - Link to comparison with previous revisionblamelink - Link to the blame information for this filefileviewloglink - Link to the log page for the fileNote: Use command [websvn-getlisting] to display the listing.Variables defined for diff.tmpl~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~action - Action being performed ("Diff")locwebsvnhttp - Root of websvn directorycharset - The charset requested by the userrepname - Name of the repositoryrev - Revision being viewedpath - Path of item being loggedcurdirlinks - List of the path of this directory with links to each onerev1 - Revision of the older filerev2 - Revision of the newer fileshowcompactlink - Link to compact viewshowalllink - Link to full viewUsed in [websvn-startlisting] ... [websvn-endlisting] block:rev1lineno / rev2lineno - Line number of the next difference block. Onlydefined at the start of the block.rev2diffclass / rev2diffclass - Class name of the diff block used for colouringdifferences. The result is one of:* diff (no changes)* diffadded* diffchanged* diffdeletedrev1line / rev2line - The line under comparisonVariables defined for blame.tmpl~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~locwebsvnhttp - Root of websvn directorycharset - The charset requested by the userrepname - Name of the repositoryrev - Revision being viewedpath - Path of item being loggedcurdirlinks - List of the path of this directory with links to each oneUsed in [websvn-startlisting] ... [websvn-endlisting] block:lineno - Line number of the linerevision - Revision in which the line changedauthor - Last author to modify the lineline - The line itselfVariables defined for compare.tmpl~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~action - Action being performed ("Path Comparison")repname - Name of the repositorypath1 - First path being comparedrev1 - Revision of first pathpath2 - Second path being comparedrev2 - Revision of second pathsuccess = true if the comparison succeededrevlink - Link to reverse comparisoncompare_form - HTML <form> specification for the comparison formcompare_path1input/compare_path2input - HTML specifications for the path input areascompare_rev1input/compare_rev2input - HTML specifications for the revision input areascompare_submit - HTML <input> specification for the comparison buttoncompare_endform - HTML </form> specification for the comparison formUsed in [websvn-startlisting] ... [websvn-endlisting] block:newpath - Name of new file under comparison (only defined at start of block)difflines - Lines changed information for this file. Start of diff lines.(only defined after newpath)diffclass - Class name of the diff block used for colouringdifferences. The result is one of:* diff (no changes)* diffadded* diffdeletedline - The line under comparisonenddifflines - End of diff linesproperties - Property changesendpath - End of current path