261 Broad Street
Windsor, CT 06095
(860) 285-0172

Your Website Should Be Easy to Edit

GetHTML Tags

A GetHTML tag is replaced by HTML in the web browser. You can put these into Content, Framework, and Custom Templates.

Basic Syntax
A basic GetHTML tag looks like the following:
<Gethtml data="" id="" mode="" object=""/>

DATA is the type of information pulled out of the database. In a sense, it is the XML. It will include information such as a list of pages, a single page, upcoming events, etc. (ex: DATA="extendedobject")

Note: Some calls have additional information. For example, a search for newest pages will also need to know how many days old they should be.

ID is the page where the data is pulled from. For example, if you are pulling out a list of upcoming events, you need to specify the calendar id. (ex: ID="/calendar/")

MODE is the XSL file that will be used to translate the XML. If you go into the chosen template directory, you should find a file with the same name. (ex: if you use mode="default" - The system will look for default.xsl in the directory) For a calendar it might be something like "upcomingevents". For a navigation bar it might be "nav" or "nav2" or "nav3".

OBJECT is the folder that holds the XSL file. This is the Custom Template, or maybe just a Template in the \System\CurrentVersion\Templates directory.

Note: You may want to explore the \System\CurrentVersion\Templates directory to get an idea of different Object and Mode calls you can use.

Note: Object is equivalent to ObjType which was used on older versions of Invisible Gold.

Advanced Options
It is very common to use this template with GetHTML calls. For example, you may have a GetHTML call that displays the newest sections of the site:

<gethtml data="datesearch" daysold="60" id="/" levels="3" mode="default" object="staticlist"/>

The sections would be displayed every much like a Static List page. You could change the template to show links to each of the pages returned instead.

<gethtml data="datesearch" daysold="60" id="/" levels="3" mode="default" object="default"/>

Now it shows thumbnails for each page, a link, and the descriptions.

This pulls out the XML (DATA) for a single page (based on the ID given). It doesn't include the child pages. It doesn't include images. It is useful if you want to pull the text or title from a page.

ex: <gethtml data="object" id="/address/" mode="text" object="default"/> - This example pulls text from a page at /address (probably a hidden page). It might be placed on the bottom of the navigation bar in a Framework to display a business's address.

This pulls out all of the information on a specific page (based on the ID). It includes Images, Files, Child Pages, Parent Page, etc.

ex: <gethtml data="extendedobject" id="/sponsors/" mode="default" object="sponsors"/> - This would display a list of sponsor icons. Of course this assumes that you have a Custom Template in the site called /Templates/Sponsors/Default.xsl. The /Sponsors/ page might be a regular URL List template and might be hidden.

This selects a child page at random from the ID you set and includes whatever Image or Files are in that Object.

ex: <gethtml data="random" id="/clients/" mode="featured" object="default"/> - This would randomly choose a Child of /clients/ and display it using the featured.xsl file in \system\currentversion\templates\default.

This works with a Calendar Template to display all events within "Days" of today.

ex: <gethtml data="upcomingevents" days="14" id="/calendar/" mode="list" object="calendar"/> - This would show a list of events happening in the next 14 days using the file list.xsl in the \system\currentversion\templates\calendar directory.

Note: Starting with 2.9, you can also use days="all" for all upcoming events. (Up to ten years)

Note: There is a new feature for 2.9 that lets you specify what day it considers today. This is useful for a newsletter when you want to find all newly posted pages before a specific day in the past. You would simply use something like Today="12/5/2005".

This would return a list of all of the pages on a site (or starting with the page in ID and a certain number of LEVELs below). Be careful that you don't have it search too many pages as this can impact performance.

ex: <gethtml data="datesearch" levels="2" daysold="45" id="/articles/" mode="teaser" object="default"/> - This would automatically search the articles page and return a list of all of the pages created in the past 45 days. Levels refers to how many pages deeper to search. For example, you can set this very high and set ID="/". This would effectively search the entire site.

Note: There is a new feature for 2.9 that lets you specify what day it considers today. This is useful for a newsletter when you want to find all newly posted pages before a specific day in the past. You would simply use something like Today="12/5/2005".

This works almost exactly the same way as DateSearch, except it looks for pages with names that match a specific value. It requires an additional parameter Name="".

<gethtml data="namesearch" levels="2" id="/glossary/" mode="default" object="definition" name="{/ROOT/OBJECT/NAME}/> - This would find all of the pages with the same value as what's in the Name parameter.

This example could have been simpler if name="John" was used. It would pull out all of the pages called "john" or "JOHN", etc. However, this example would be used in a Custom Template. It would find all pages with the SAME name as the current page.

This works the same way as NameSearch, except it searches for a specific bit of text anywhere in the pages. It could be in the title, the name, the text, etc.

Note: This GetHTML call is very powerful and can be used for a wide variety of situations. However, like the other Search calls, it can impact your site's performance.

ex: <gethtml data="textsearch" id="/system/mailinglists/clients/" levels="1" name="Restaurant" mode="results" object="search"/> - This would automatically search a mailinglist for all of the entries that have the word "Restaurant" somewhere in the text.

Note: You would need to set the security on the specified Mailing List to allow regular users to View that ID. Otherwise this would only return results for logged in Users.

This downloads an RSS (Really Simple Syndication) stream from another website and combines it with a template.

Note: RSS is also XML, but it is very different than any of the Invisible Gold XML. You'll need to use a template (XSL files) designed to work with RSS data. (They can be found all over the Internet).

<gethtml data="rss" src="http://news.com.com/2547-1_3-0-5.xml" mode="rss" object="rss"/> - This would download the RSS feed from the news.com.com site and use a file called rss.xsl in the \system\currentversion\templates\rss\ directory.

NOTE: The RSS call requires an additional parameter SRC="". You can find RSS feeds by doing a search for the word RSS. As long as it is described as an RSS feed, it is the same thing even if it has a very different name.

This only works for sites with the Banner Ad system. It returns all of the ads found in a specific Banner Ad list with a ShowList and a HideList that matches the value in ID. For example, if ShowList has "/", then every page on your site would match and show the ads. However if ID="/example/", the Ad might show on every page in your site, except for /example/ and all of the pages underneath it.

For more information, read the Banner Ads section of Support.

"ID=" Options
The ID parameter is actually quite powerful. There are three basic things you can do with it.

ID="/" This specifies a specific page. The"/" indicates the homepage. It could also be id="/sponsors/", for example.

ID="." specifies the current page being loaded. For example, if you are loading "/sponsors/", Then it would effectively become ID="/sponsors/". If you reloaded the site on the homepage, it would use ID="/".

ID="/./." This specifies a relative page path. In this case, it would use the page in the current path two levels below the homepage. If the current page is "/support/docs/gethtml/", then it would use "/support/docs/". If you go back to the homepage, it would use "/". If you went to "/support/", it would use "/support/".

Note: You can also use ".." or "../.." to specify the page above the current page. I can't remember doing this once in the past 3 years though.

Almost all of the various Data="" calls above include the parameter Request="". If you are creating Custom Templates, it can be used to send variables right into the XSL. Contact Invisible Gold for examples of its use.

See Also:
Online Documentation Home, Advanced: Using Drop Down Menus With Calendars, New CSS Menus, Overview, Directory Structure, Frameworks, Custom Templates, Web Designer Tip: Customize the Page Title, Creating Drop Down Menus, GetHTML Tags

Authoring, Templates, Custom, Gethtml