Changes between Initial Version and Version 1 of Documentation/Plugins/InsertSnippet2


Ignore:
Timestamp:
03/15/18 00:59:07 (13 months ago)
Author:
gogo
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Documentation/Plugins/InsertSnippet2

    v1 v1  
     1= Plugin: InsertSnippet2  = 
     2 
     3Provide functionality to insert snippets of HTML (or any other text, such as variable substitutions), with XML structure defining snippets. 
     4 
     5 
     6[wiki:Plugins Back to Plugins] 
     7 
     8== Configuration == 
     9 
     10**See the [wiki:NewbieGuide#ProvideSomeConfiguration NewbieGuide] for how to set configuration values in general, the below configuration options are available for this plugin.** 
     11 
     12 
     13  xinha_config.InsertSnippet2.snippets = '/url/path/to/snippets.xml';:: 
     14    The URL path to an XML file which defines snippets. 
     15 
     16 
     17=== Example snippets.xml file === 
     18 
     19{{{ 
     20<?xml version="1.0" encoding="UTF-8"?> 
     21<!DOCTYPE snXML PUBLIC "Xinha InsertSnippet Data File" "http://x-webservice.net/res/snXML.dtd"> 
     22<snXML> 
     23    <categories> 
     24        <c n="Test Category 1"/> 
     25        <c n="Test Category 2"/> 
     26        <c n="Test Category 3"/> 
     27    </categories> 
     28    <snippets> 
     29        <s n="Box 1" v="{$Snippet_Test_0}" c="Test Category 1"> 
     30            <![CDATA[ 
     31              <div class="message_box red"> 
     32                 Visit the <a href="http://xinha.org">Xinha website</a> 
     33              </div>            </li><li> Nulla placerat nunc ut pede.                 </li><li> Vivamus ultrices mi sit amet urna.           </li><li> Quisque sed augue quis nunc laoreet volutpat.</li><li> Nunc sit amet metus in tortor semper mattis. </li></ul> 
     34            ]]> 
     35        </s> 
     36        <s n="INFORMATION ABOUT SOMETHING" v="{$Snippet_Test_1}" c="Test Category 3"> 
     37               &lt;p&gt;This is some information about something&lt;/p&gt; 
     38        </s> 
     39        <s n="Menu" c="Test Category 2"> 
     40            <![CDATA[ 
     41              <ul class="navi_links"> 
     42                 <li class="navi"> 
     43                      <a href="Link1" class="Link1" tabindex="1"><span class="span_class"> Link1 </span></a> 
     44                 </li> 
     45                 <li class="navi"> 
     46                      <a href="Link2" class="Link2" tabindex="2"><span class="span_class"> Link2 </span></a> 
     47                 </li> 
     48                 <li class="navi"> 
     49                      <a href="Link3" class="Link3" tabindex="3"><span class="span_class"> Link3 </span></a> 
     50                 </li> 
     51                 <li class="navi"> 
     52                      <a href="Link4" class="Link4" tabindex="4"><span class="span_class"> Link4 </span></a> 
     53                 </li> 
     54                 <li class="navi"> 
     55                      <a href="Link5" class="Link5" tabindex="5"><span class="span_class"> Link5 </span></a> 
     56                 </li> 
     57              </ul> 
     58            ]]> 
     59        </s> 
     60    </snippets> 
     61</snXML> 
     62}}} 
     63 
     64Obviously you can generate this file manually, or dynamically by whatever processes you desire, just specify the path to it in the configuration.