| filsa.net: Frontier Scripting [ Script Archive | Ideas & Issues | Polyglot | Software | Projects ] |
|
|
Creating META tagsHow can I put <meta> tags into my Frontier web pages?When Frontier builds a web page (everything between the opening <html> tags through to the opening <body> tag), it calls a special script that handles <meta> tags.The script is called metaTags, and is located at html.data.standardMacros.metaTags. How the metaTags script works You almost never call the metaTags directly--it gets called by scripts that build the top part of the page. So to get it to do your bidding, you send it messages--via directives. A directive, as you recall, is a line in a website object, that begins with a pound sign (#). To control the metaTags script, you need to use directives that begin with #meta. The name's the thing Frontier processes your #meta directives based on their name. There are three kinds of names:
The plain #meta directive The simplest way to add something to inside the <HEAD> tags of your page is to define a #meta directive. This can be a string or wp text object, or outline--doesn't matter. Whatever is in that object goes into the <HEAD> of the page, exactly as you typed it.
The image above shows a plain #meta directive, which is in a wptext object. Remember, this can be a string or outline in your website table, or just a #directive at the top of a page, as shown below...
Whoops. I'm getting ahead of myself. Notice that the example above shows the directive #metaTopic! What is that? Well, it's the #metaSomething format. Before we go further, check out the source for this page to see it in action, and see if you can guess how it works. #metaSomething When Frontier sees a directive that begins with 'meta' and is followed by something in the name, it builds a meta tag that looks like this: <meta name="something" content="the value of metaSomething"> #metaEquivSomething There's another kind of meta tag: Instead of a name/content attribute pair, it has a http-equiv/content attribute pair. Using the http-equiv/content attribute pair is really powerful. It allows us to mimic real HTTP commands from a server--and force the browser to do some interesting things. Probably the most common use of http-equiv is to force a page to refresh--or load another page after a short period of time. Consider this example: #metaEquivRefresh "n;URL=the URL" results in: <meta HTTP-EQUIV="Refresh" CONTENT="n;URL=the URL"> where n is the number of seconds before the URL loads into the browser. Another common use of http-Equiv is Pragma. It prevents a page from being cached. The value of a meta pragma tag is always, "no-cache". In Frontier, it would look like this: #metaEquivPragma "no-cache" Examples #metaLocation "Chicago" results in <meta name="Location" content="Chicago"> The image below shows how this website's #metaSomething directives are set up. See the source to see how it turned out.
Two more meta-related directives There are two more meta-related directives:
These directives can also be set in user.html.prefs. (I set both of these to false.) Other Links
|
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
This is Phil's Frontier Scripting Site. San Francisco, CA |
| filsa.net: Frontier Scripting [ Script Archive | Ideas & Issues | Polyglot | Software | Projects ] |