261 Broad Street
Windsor, CT 06095
(860) 285-0172
support@invisiblegold.com

Your Website Should Be Easy to Edit


Web Designer Tip: Customize the Page Title

Normally Invisible Gold manages the title tag automatically. It takes the "name" of each page and combines it with the "title" value stored in the settings page.

This doesn't work well when using an external database of products. For example, if you upload an Excel or Access database file with a list of products, the titles are all going to be the same.

The solution is to create a PageTitle.xsl file and put it into the /templates folder. This gives granular control over what the title tag is. There are lots of ways to use it, but the most common are building the title out of request parameters (ex: website.com/page.htm?productname=abc can be accessed via /ROOT/REQUEST/PRODUCTNAME), values loaded from the database directly (/ROOT/OBJECT/NAME), or parameters which are just a fancy way of passing request parameters.

This page is an example of how to use it with a database. Note, it requires version 3.1 or higher. Just create a file called /templates/PageTitle.xsl and paste the following contents into it.

Note: This example uses "params". This is another advanced trick often used for search engine optimization. Basically, you load a regular page and then add values like "directories" at the end of the address. For example, imagine the page website.com/mypage. You can pass params by loading the page website.com/mypage/a/b/c. PARAM0=a, PARAM1=b, PARAM2=c.


Download this file. Then rename to pagetitle.xsl and move to /templates.