Links SQL Help


Table of Contents

Template Help

Links SQL is powered entirely by templates. Any part of the output you want to change can easily be altered by editing one of the templates.

Template Sets:
You can have as many template sets as you need. By default Links SQL comes with 5 template sets: the default look, the simple look, a Snap clone, a Yahoo clone and an AltaVista clone. You can create as many as you want. You can use multiple template sets to provide multi-language versions of your directory, or to brand your directory in a different look.

If you are using Dynamic pages, you can view your templates by simplying going to page.cgi?t=simple where simple is the name of the template set you want to use. So you could create a link page.cgi?t=english and page.cgi?t=french to provide two different language versions for your visitors.

You can set what template is used by default, and when building html pages in Setup-> Build Options.

Template Structure:
Links SQL template sets are layed out as follows:

admin/templates/
                default/
                        local/
                        compiled/
                av/
                        local/
                        compiled/
                ..

default and av are called template sets, and inside each template set are the original templates that ship with Links SQL. If you wish to make changes to a template manually (using FTP, or the included FileMan), you must save your altered template inside the local directory. The way it works is that Links SQL will look for your template first in the local directory, then inside the main template set directory. So if you only change the header and footer, all you do is save include_header.html and include_footer.html inside the local directory.

When you upgrade, Links SQL will overwrite all files in your default directory, so you must put your changes inside local. If you use the template editor included in Links SQL, it will do this for you.

The compiled directory is where Links SQL converts your template to code for faster execution. You should not need to touch any files in this folder.

Templates:
Links SQL has quite a few templates. You can think of each "screen" being equal to one template. So when a user clicks on add and sees an add form, that screen is represented by one template (convienantly named add.html). Similairly, the search results are represented by a template search_results.html. We'll outline the templates and what they are used for:

File: Description:
add.html This is the add form, and is used whenever add.cgi is called.
add_success.html This is the screen a user sees after successfully submitting a link to be added to the directory.
browser*.html This controls the editor section and replicates the same javascript interface you see in your admin. You do not typically need to edit any of these files.
category.html This represents a category page. For instance, if you have a category Computers, this template lays out all the subcategories and links on that page.
detailed.html If you are using detailed pages (where you have one html page per link), then you can modify this template to describe what a detailed page should look like.
email-add.txt This is the email users get once their link has been validated by the admin.
email-del.txt This is the email users get if their link is rejected by the admin (admin can customize, or choose not to send it on a per link basis).
email-mod.txt This is the email users get if the changes the user requested to a link were successfully approved by the admin.
email-password.txt This is the email users get when they request that their password be emailed to them.
email-validate.txt If you require that users be validated (check for valid email address), this template will be mailed to them with their validation code.
email.html This template is displayed whenever users signup for the newsletter.
home.html This is your main Links SQL home page and displays the top level categories.
link.html This represents what a single link looks like, and is not a complete page, but only an HTML fragment. It is used on the category page, the what's new listing, the what's cool listing and the search results. If you want to change how a single link looks, then this is the template!
login.html This is the login form.
login_email.html This is the page where users can have their password emailed to them.
login_success.html This is the page users see after successfully logging into Links SQL.
modify.html This is the modify form and lets users enter in the changes they want to make to a link.
modify_success.html This is the page users see after succesfully submitting changes to a link.
new.html This page displays a list of all new links.
rate.html This is the rate form, and lets users rate the link between 1 and 10.
rate_success.html This is the page a user sees after successfully rating a link.
rate_top.html This page displays the list of top rated links and links with the most votes.
review_add.html This page displays a form where a user can submit a review about a link.
review_add_success.html This page is displayed after successfully submitting a review. If there was an error with the review, review_add.html is displayed.
review_edit.html This page lets a user edit an existing review (to modify it).
review_edit_success.html This page is displayed after successfully modifying a review. If there was an error with the review, review_edit.html is displayed.
review-email-add.txt This email is mailed to the user after his review has been successfully added.
review-email-del.txt This email is mailed to the user after his review has been rejected.
search.html This is the search form.
search_results.html This displays the matching category and link results.
signup_form.html This page lets users signup and join your directory.
signup_success.html This is the page user see after succesfully signing up.
subcategory.html This represents what one row in the category results look like. So on your home page, where it lists all the top level categories, if you wanted to change the font on the category name, you would edit this template.
validate_form.html If you require users to validate their email address, then this is the page they will see. They must enter a validation code on this form to prove their email address is correct.
validate_success.html This is page users see after successfully validating their account.

There are also some other files in the templates directory that you should be aware of:

File Description
language.txt This is your language file, and contains all the language the program uses. This is what is being altered when you go to Build->User Language. You should not normally edit this file by hand, but rather use the admin interface.
globals.txt This is your globals file. It contains a list of tags that will be available on every template. You should not edit it by hand, but rather use the built in editor in the admin.
include_* To make the templates easier to edit, we use includes which work exactly like SSI. You just put <%include filename.html%> in your template, and that file will be placed inside your template. The default templates have a common header and footer, as well as menu and search bar.

For help on editing templates, be sure to read our Template Syntax section. For tags you can use on the templates, be sure to read the Template Tags section.

Table of Contents