Introducing XWeb
|
Doing more than just layoutThe stylesheet allows you to use some additional features which go behind just adding some layout and CSS markup. Turning off JavascriptPer default Javascript will be used for mouse-over effects on graphical buttons. This can be turned off by setting the parameter feature.javascript to "off". Adding header and footerA header and a footer can be included into the results. This can be done by giving some XHTML in seperate files where a header file has to look like this: <?xml version="1.0" encoding="UTF-8"?> <header> <p class="header">My Famous Site</p> </header> And a footer similar but using the root element <footer> instead. The XHTML in there is just copied into the result pages, so you can use any XHTML for this purpose. Here we give just one paragraph with a special CSS class so we can easily format it. This approach was used to get the title on this manual. The name of the header file is given as value for the parameter feature.include.header, the footer file position as value of feature.include.footer. If the location is given as relative url it will be interpreted as relative to the stylesheet. In the default structure giving only a file name for header and footer would mean that they will be searched in the layout directory. Resolving internal linksIf you want to link from one of your pages to another the next feature might be very useful. If you set the parameter feature.internalLink.token to some string this will be interpreted as a token to identify internal links. For example if you set this to the string "!" every link url starting with "!" will be interpreted as internal link and the stylesheet will try to resolve it by looking for an entry with an id attribute set to the rest of the url. A link like <a href="!cv"> would point to an entry like this: <entry name="CV" title="Curriculum Vitae" sourceFile="cv.xml" targetFile="cv.html" type="cvit" id="cv"/> Note that you should not include the token in the id attribute. If no such entry can be found, the link will be dropped completely and a message will be printed on the console. Be sure to check the messages on the console if you want to make sure that all links are ok. You are not limited to one character, a token like "int:" will work, too. All links generated like this will have the CSS classxwebLink attached to them so they can be distinguished visually, as done in this site. Numbering paragraphsIf you set feature.numberParagraphs to "on" each paragraph in the output will be directly addressable through anchor tags and will have a number in parentheses behind it, which links to this anchor. This can be used if you want people to be able to discuss specific paragraphs in your site, they can either just give you the number of the paragraph or they can click on the number and then give the full url including the anchor name in it. The number behind the paragraph uses an HTML span with the CSS classparagraphNumber so you can format it like you want. Note that the numbering of the paragraphs will be generated from scratch whenever you call XWeb, if you introduce new paragraphs or remove old ones old links get broken. |