mirror of
				https://github.com/node-red/node-red.git
				synced 2025-03-01 10:36:34 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			58 lines
		
	
	
		
			2.6 KiB
		
	
	
	
		
			HTML
		
	
	
		
			Executable File
		
	
	
	
	
			
		
		
	
	
			58 lines
		
	
	
		
			2.6 KiB
		
	
	
	
		
			HTML
		
	
	
		
			Executable File
		
	
	
	
	
<!--
 | 
						|
  Copyright JS Foundation and other contributors, http://js.foundation
 | 
						|
 | 
						|
  Licensed under the Apache License, Version 2.0 (the "License");
 | 
						|
  you may not use this file except in compliance with the License.
 | 
						|
  You may obtain a copy of the License at
 | 
						|
 | 
						|
  http://www.apache.org/licenses/LICENSE-2.0
 | 
						|
 | 
						|
  Unless required by applicable law or agreed to in writing, software
 | 
						|
  distributed under the License is distributed on an "AS IS" BASIS,
 | 
						|
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 | 
						|
  See the License for the specific language governing permissions and
 | 
						|
  limitations under the License.
 | 
						|
-->
 | 
						|
 | 
						|
<script type="text/html" data-help-name="template">
 | 
						|
    <p>Festlegen einer Eigenschaft anhand einer Vorlage (template).</p>
 | 
						|
    <h3>Eingangsdaten</h3>
 | 
						|
    <dl class="message-properties">
 | 
						|
        <dt>msg <span class="property-type">object</span></dt>
 | 
						|
        <dd>msg-Objekt mit Informationen zum Befüllen der Vorlage.</dd>
 | 
						|
        <dt class="optional">template <span class="property-type">string</span></dt>
 | 
						|
        <dd>Mit msg.payload zu befüllende Vorlage.
 | 
						|
            Falls nicht im Editorfenster angegeben, kann die Vorlage auch als Eigenschaft von msg vorgegeben werden.</dd>
 | 
						|
    </dl>
 | 
						|
    <h3>Ausgangsdaten</h3>
 | 
						|
    <dl class="message-properties">
 | 
						|
        <dt>msg <span class="property-type">object</span></dt>
 | 
						|
        <dd>Nachricht auf Basis der Vorlage und gefüllt mit Eigenschaften aus der eingehenden Nachricht.</dd>
 | 
						|
    </dl>
 | 
						|
    <h3>Details</h3>
 | 
						|
    <p>Die Vorlage verwendet standardmäßig das
 | 
						|
       <a href="http://mustache.github.io/mustache.5.html" target="_blank">Mustache</a>-Format,
 | 
						|
      was aber bei Bedarf ausgeschaltet werden kann.</p>
 | 
						|
    <p>Beispiel: Wenn die Vorlage</p>
 | 
						|
    <pre>Hallo {{payload.name}}. Heute ist {{date}}</pre>
 | 
						|
    <p>die Nachricht</p>
 | 
						|
    <pre>
 | 
						|
{
 | 
						|
  date: "Montag",
 | 
						|
  payload: {
 | 
						|
    name: "Fred"
 | 
						|
  }
 | 
						|
}
 | 
						|
    </pre>
 | 
						|
    <p>empfängt, wird die resultierende Ausgangsnachricht wie folgt sein:</p>
 | 
						|
    <pre>Hallo Fred. Heute ist Montag</pre>
 | 
						|
    <p>Es ist möglich, eine Eigenschaft aus dem Flowkontext oder dem globalen Kontext zu verwenden,
 | 
						|
       indem <code>{{flow.name}}</code> oder <code>{{global.name}}</code> verwendet wird.
 | 
						|
       Oder für den persistenten Speicher <code>store</code> kann <code>{{flow[store].name}}</code> oder
 | 
						|
       <code>{{global[store].name}}</code> verwendet werden.
 | 
						|
    <p><b>Hinweis</b>: Standardmäßig werden bei <i>Mustache</i> sog. <i>Escaper</i>
 | 
						|
       bei allen nicht-numerischen und HTML-Entitäten erzeugt.
 | 
						|
       Z.B. <code>&</code> wird durch <code>&amp;</code> ersetzt.
 | 
						|
       Um dies zu verhindern, müssen <code>{{{dreifache}}}</code> Klammern verwendet werden.
 | 
						|
</script>
 |