^setRoot( [newRoot] )^

Tinderbox Icon


Code Type:   Export Mark-up
Code Scope of Action:   document

^setRoot( [newRoot] )^

The ^root^ code normally exports the relative path from a note to the top level of the Tinderbox document. This is valuable for defining relative paths, especially in macros.

In some cases, though, you may want a relative path in one page (an HTML page, say) and an absolute link in another (an RSS feed, where relative links may be forbidden).

The export element

^setRoot(newRoot)^

tells Tinderbox to use its first argument (newRoot) as the value of ^root^ until either

To restore relative URLs, use ^setRoot()^ with no arguments.

For example:

^setRoot(http://example.com/)^ 

Using ^setRoot()^ to set the logical host or root path for a page affects not only ^root^ but also ^url^, ^childLinks^, and ^basicLinks^.


Possible relevant notes (via "Similar Notes" feature):

Up: Document-based

A Tinderbox Reference File : Export Codes : Export Code Scope : Document-based : ^setRoot( [newRoot] )^

Quicklinks: Attributes | Action Codes | Export Codes | Designators | Date Formats | aTbRef Site Map

[Last updated: 16 May 2012, using v5.11.1]


Search:

Google search aTbRef for:  


Creative Commons Licence

aTbRef by Mark Anderson is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License.

[See aTbRef CC licence Attribution & Waiver info]

Made with Tinderbox