TGP Page Templates


AutoGallery SQL has a powerful template system for setting up your TGP pages. Not only do the templates allow you to specify the design you want for your TGP pages, they also determine how many galleries are displayed on a given page and how the galleries are sorted. Once you have read this document and understand the template system for TGP pages, you should be able to create any type of page layout imaginable.

If you are having problems with your template or are getting a blank page when you rebuild, use our template validator to check your templates for errors

Control Panel Editing Interface

All changes to your TGP page HTML will be made through the control panel. From the control panel menu, locate and click on the TGP Pages link in the Templates section. AutoGallery SQL will load a page where you will be able to select which of your TGP pages you want to edit. Select the page you want to edit from the list, and press the Load HTML button.

You will be returned to the same page, however now there will be a large text input box where you will edit your HTML code. The first time you do this, the text input box will contain AutoGallery SQL's default HTML. You can edit that HTML or paste your own HTML code into this text input box. When you are satisfied with the changes you have made, select the page that you want to save this HTML for and press the Save HTML button. You can save the HTML for multiple pages by selecting all of the pages you want to save it for from the list.

To update your actual TGP pages with the new HTML, you will need to rebuild them. See the Building Pages section of the manual for more information on that.

Before Making Changes

Before you start making changes to the default HTML, it is recommended that you look it over and try to understand it. Seeing an example of how the template system works should make it easier for you to create your own templates. It is also recommended that you add a few test galleries to see how they are displayed with the default template.


Your TGP page templates have several valid directives that you can use. These are very important, as they determine where your galleries are placed on the page, how they are sorted, and how many are displayed. Each of the directives is described below.


The GALLERIES directive allows you to include sub-directives so that you can insert permanent galleries and other HTML in the middle of the section of galleries. An example of a GALLERIES directive that contains sub-directive is: <%GALLERIES TYPE Text CATEGORY Mixed DATE 0 AMOUNT 100 SORT Display_Date DESC, Display_Stamp DESC HTML Default Text SWITCH { LOCATION 50 HTML New Text } PERMANENT { LOCATION +5 HTML Default Text TYPE Text CATEGORY Mixed } RANDOM { LOCATION +10 HTML Default Text FILE random.txt } INSERT { LOCATION 3,6,12 HTML </td><td> } %> The SWITCH, INSERT, RANDOM and PERMANENT values are the sub-directives. Note that the options for the sub-directives are enclosed in curly braces; this must always be done. In this example, the options for the sub-directives have been indented. This is not required, but does make them easier to locate and read.


The GALLERIES directive allows you to specify how you want the galleries sorted when they are displayed. AutoGallery SQL offers you several options for sorting your galleries. Each of the options is listed below. All of these values can be modified with DESC to sort in descending order instead of ascending order. Additionally, these values may be combined together to generate sub-sorting options. We'll give a few examples of what will probably be commonly used sorting options. Template Values

Your TGP pages have many template values available. Some can be used anywhere on the page, and some can only be used in the HTML option of certain directives. All of the available template values and the locations where they can be used are described below.