WebMetaLecture - a lecture about Website Meta LanguageExample 4 : Frames-Enabled and Non-Frames-Enabled Sitesnavbar-frame.html.wml

8.4. navbar-frame.html.wml

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
<title>Navigation Bar</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="StyleSheet" href="$(ROOT)/style.css" type="text/css" />
<define-tag navbarlink>
# Check if we are an index page and define suffix accordingly
<if <match "%0" "(/$)|(^$)" action="report" />
    <set-var suffix="index.html" />
    <set-var suffix="" />
<a href="%0<get-var suffix />.frames.html">%1</a>
<br />

#include 'navbar.wml'

<br />
<a href="$(ROOT)">No Frames Version</a><br />



One can see her use of variables - <set-var ... > and <get-var ... >.

Written by Shlomi Fish