InsertSnippet2 for Xinha
Insert HTML fragments or template variables in your document.
- Categorization to organize your snippets if you have a lot (optional)
- Search for name
- Insert as literal text/html or variable (optional)
- XML data format
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">
<p>some text or HTML, please entize HTML tags</p>
<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 (email@example.com)