Template-manager:Upload template

From Site Foundry

Jump to: navigation, search

Uploading a template - why?

Template manager
Template manager

Templates are the basis of the display side of the Site Foundry application. You will need at least two templates to display content on a page - one site template with one area, and one pages template with one area.

Unfortunately, because of their functionality they get a little bit complicated, but if you take a look over the how it works page, and then read down to templating, this will give you a good idea of how things are constructed.

But we're uploading templates, and this is a little harder than just laying them out. As we upload the resources, we need to declare what each file contains so that the database can link in each area to a resource.

When declaring site template areas, it is important to think of meaningful, short names. Remember, because you can manipulate the content using CSS, and position within the template - calling something right column is sort of poor form. There are no columns in HTML, and design can change, so that the data can be displayed in any location/order.

Upload a template

  1. To upload a new template, click on the template manager menu item on the top of the page.
  2. Select a template file by clicking the browse button next to the input field labelled Template File. This file must have the extension .tpl, but does not require any content; though of course you can upload a completed template file.
  3. Select a thumbnail file by clicking the browse button next to the input field labelled Thumbnail. This file must be a meaningful representation of your template (styled by CSS) so that administrators can select resources for areas correctly. This should follow your final CSS layout, so that there is a frame of reference to the front-end display. Remember you can leave both file fields blank to create an auto-generated template; you can then make any changes the .jpg file to reflect the layout.
  4. Select a resource - site for site wide templates, pages for the pages module.
  5. Give the template a title.
  6. Click the upload button. Your template should now be uploaded to the server.
  7. Click on the newly created template icon to then add the fields - these will be auto discovered from the content of your template file, in the form:
{$content.area1} {$content.area2}

For more info on what you can put into your template file, see here

NB: if you have problems uploading, this is usually because the permissions on the folders:

/templates/usrTemplates & /modules/pages/templates

Needing to be writeable by PHP.