InsertSnippet2 for Xinha

Insert HTML fragments or template variables in your document.



In order to use your own snippets you have to add a parameter to your xinha_config:

xinha_config.InsertSnippet2.snippets = "/path/to/your/snippets.xml";

This path should point to a XML file that has the following format:

    <c n="the name" />
        <s n="the name" v="optional variable name to be inserted" c="the category">
            &lt;p&gt;some text or HTML, please entize HTML tags&lt;/p&gt;
        <s n="another">
               <p>or put HTML in a CDATA section</p>


 The root tag
 This tag contains the categories (optional)
 <c />
 Each category
This tag contains the actual snippet. As this is XML, you cannot put HTML here literally. You have to either entize the <,>, and & characters or wrap the contents in a CDATA section


 The name of one snippet or category. It is obligatory for both.
If this attribute is present in a snippet tag, there is a button in the UI that allows to insert this variable instead of the textual content of the snippet.
 The category

Inside the plugin's directory, there is a sample XML file and PHP script that shows how to create the XML dynamically.

3 October 2008 Raimund Meyer (