{"id":474570,"date":"2008-06-30T17:00:55","date_gmt":"2008-06-30T21:00:55","guid":{"rendered":"https:\/\/segue.middlebury.edu\/view\/html\/node\/474570"},"modified":"2008-06-30T17:00:55","modified_gmt":"2008-06-30T21:00:55","slug":"templates","status":"publish","type":"page","link":"https:\/\/segueproject.org\/segue-documentation\/segue-v2\/documentation\/for-administrators\/templates\/","title":{"rendered":"Templates"},"content":{"rendered":"<h3>About Templates<\/h3>\n<div>\n<p>Templates can be thought of a &#8216;site starting points&#8217;. They consist of site export files (<code>site.xml<\/code> and <code>media\/<\/code>), an <code>info.xml<\/code> file, and an optional <code>thumbnail.png<\/code> image. <\/p>\n<p>Templates are kept in two directories: <code><br \/>\n<\/code><\/p>\n<ul>\n<li><code>segue\/templates-dist<\/code> &#8211; Templates distributed with Segue<\/li>\n<li><code>segue\/templates-local<\/code> &#8211; Your own custom templates<\/li>\n<\/ul>\n<p>The ID of a template is its directory name, e.g. <code>segue\/templates-dist\/Basic<\/code> has an ID <em>Basic<\/em>.<\/p>\n<p>By default, templates are ordered alphabetically by ID. A custom ordering can be set in <code>segue\/config\/templates.conf.php:<\/code><\/p>\n<pre>$templateMgr-&gt;setOrder(array(<br \/> \t&quot;StandardCourseSite&quot;,<br \/> \t&quot;Basic&quot;,<br \/> \t&quot;Blog&quot;<br \/>));<\/pre>\n<p>Any templates not listed in the order array will be displayed alphabetically after the ordered templates.\n<\/p><\/div>\n<h3>Creating Templates<\/h3>\n<div>\n<p>While the template XML can be edited by hand, the easiest way to create a template is to start from an existing site.<\/p>\n<ol>\n<li>Create a site that you will use to build your template.\n<p>Enter #SITE_NAME# and #SITE_DESCRIPTION# for the display-name and description of the site to pre-populate the template-site with appropriate placeholders.<\/p>\n<\/li>\n<li>Configure the site to your liking. Any place you use #SITE_NAME# or #SITE_DESCRIPTION# in the text, the placeholder will be replaced with the site name and description that users enter when the create a new site using this template.<\/li>\n<li>Export the site<\/li>\n<li>Un-Tar the exported archive.<\/li>\n<li>Create a new directory (to go in <code>segue\/themes-local\/<\/code>) named for the template<\/li>\n<li>Place <code>site.xml<\/code> and <code>media\/<\/code> directory (if it exists) into the new template directory<\/li>\n<li>Add an <code>info.xml<\/code> file to the new template directory with information about your template.\n<pre>&lt;TemplateInfo&gt;<br \/>    &lt;DisplayName lang='en_US'&gt;Basic&lt;\/DisplayName&gt;<br \/>    &lt;Description lang='en_US'&gt;<br \/>        This template is a basic starting point with two pages already created.<br \/>    &lt;\/Description&gt;<br \/>&lt;\/TemplateInfo&gt;<\/pre>\n<\/li>\n<li>You can optionally add additional translations of the display name and description.\n<pre>&lt;TemplateInfo&gt;<br \/>    &lt;DisplayName lang='en_US'&gt;Spanish School Template&lt;\/DisplayName&gt;<br \/>    &lt;Description lang='en_US'&gt;<br \/>        This template is laid out for classes taught by the Spanish School and<br \/>        Spanish department.<br \/>    &lt;\/Description&gt;<br \/>    &lt;DisplayName lang='es_ES'&gt;Plantilla de la Escuela Espa&ntilde;ola&lt;\/DisplayName&gt;<br \/>    &lt;Description lang='es_ES'&gt;<br \/>        Esta plantilla se presenta para las clases ense&ntilde;adas por la escuela <br \/>        espa&ntilde;ola y el departamento espa&ntilde;ol.<br \/>    &lt;\/Description&gt;<br \/>&lt;\/TemplateInfo&gt;<\/pre>\n<\/li>\n<li>You can optionally add Agent or Group restrictions to the <code>info.xml<\/code> to make the template only available to certain users.\n<pre>&lt;TemplateInfo&gt;<br \/>    &lt;DisplayName lang='en_US'&gt;Spanish School Template&lt;\/DisplayName&gt;<br \/>    &lt;Description lang='en_US'&gt;<br \/>        This template is laid out for classes taught by the Spanish School and<br \/>        Spanish department.<br \/>    &lt;\/Description&gt;<br \/>    &lt;DisplayName lang='es_ES'&gt;Plantilla de la Escuela Espa&ntilde;ola&lt;\/DisplayName&gt;<br \/>    &lt;Description lang='es_ES'&gt;<br \/>        Esta plantilla se presenta para las clases ense&ntilde;adas por la escuela <br \/>        espa&ntilde;ola y el departamento espa&ntilde;ol.<br \/>    &lt;\/Description&gt;<br \/>    &lt;Authorized&gt;<br \/>\t\t&lt;Group id=&quot;123456&quot;&gt;Spanish School&lt;\/Group&gt;<br \/>\t\t&lt;Agent id=&quot;789102&quot;&gt;Spanish School Coordinater&lt;\/Agent&gt;<br \/>\t\t&lt;Group id=&quot;CN=Spanish Dept,OU=Groups,dc=example,dc=edu&quot;&gt;Spanish Department Faculty&lt;\/Group&gt;<br \/>    &lt;\/Authorized&gt;<br \/>&lt;\/TemplateInfo&gt;<\/pre>\n<p>    The ids of the Groups and Agents should match those in your Agent system, but the name is just an aid to provide information in a template listing.<\/li>\n<li>If you haven&#8217;t already, put the new template directory in <code>segue\/themes-local\/<\/code><\/li>\n<\/ol>\n<p>With these steps done, the template should show up in the list of templates when users go into the &#8216;create site&#8217; wizard.\n<\/p><\/div>\n","protected":false},"excerpt":{"rendered":"<p>About Templates Templates can be thought of a &#8216;site starting points&#8217;. They consist of site export files (site.xml and media\/), an info.xml file, and an optional thumbnail.png image. Templates are kept in two directories: segue\/templates-dist &#8211; Templates distributed with Segue&hellip; <a href=\"https:\/\/segueproject.org\/segue-documentation\/segue-v2\/documentation\/for-administrators\/templates\/\" class=\"continue-reading\">More &rarr;<\/a><\/p>\n","protected":false},"author":29,"featured_media":0,"parent":480958,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-474570","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/segueproject.org\/segue-documentation\/wp-json\/wp\/v2\/pages\/474570","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/segueproject.org\/segue-documentation\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/segueproject.org\/segue-documentation\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/segueproject.org\/segue-documentation\/wp-json\/wp\/v2\/users\/29"}],"replies":[{"embeddable":true,"href":"https:\/\/segueproject.org\/segue-documentation\/wp-json\/wp\/v2\/comments?post=474570"}],"version-history":[{"count":0,"href":"https:\/\/segueproject.org\/segue-documentation\/wp-json\/wp\/v2\/pages\/474570\/revisions"}],"up":[{"embeddable":true,"href":"https:\/\/segueproject.org\/segue-documentation\/wp-json\/wp\/v2\/pages\/480958"}],"wp:attachment":[{"href":"https:\/\/segueproject.org\/segue-documentation\/wp-json\/wp\/v2\/media?parent=474570"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}