Daisy documentation
 PreviousHomeNext 
5.21 Variables in documentsBook Index5.21.3 Defining variables

5.21.2 Quick variables how-to

These are the basic steps to put variables in action.

Create a new document of type Variables and save it. As you will see, the editor for the variables is simply XML-source based. Take note of the ID of the created document, you'll see it in the URL after saving, something like 55-DSY.

Create one of these files, depending on whether you want to configure variable resolution per-site or for the Wiki as whole:

site-specific:
<wiki data dir>/sites/<sitename>/conf/variables.xml

global:
<wiki data dir>/conf/variables.xml

And put the following in it:

<?xml version="1.0"?>
<variables>

  <variableSources>
    <variableDocument id="55-DSY"/>
  </variableSources>

  <variablesInAttributes allAttributes="true"/>

</variables>

In this XML, change the value of the id attribute to the ID of the created variables document.

Allow up to ten seconds for the Wiki to notice this configuration change.

You are now ready to start using variables. Create a new document (e.g. of type Simple Document), on the toolbar of the rich text editor there's a button to insert variables. If you insert one, and save the document, you should see the variable resolved to its value.

 PreviousHomeNext 
5.21 Variables in documents5.21.3 Defining variables