<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Tokens in templates? in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/Tokens-in-templates/m-p/124440#M7316</link>
    <description>&lt;P&gt;I want to put a token into a panel-header and tried to use the token_safe filter as such:&lt;/P&gt;

&lt;P&gt;{% filter token_safe %} The selected pool is $selectedPool$ {% endfilter %}&lt;/P&gt;

&lt;P&gt;While this is valid in django (e.g. replace token_safe with lower), it is not translating my token. &lt;/P&gt;

&lt;P&gt;What is the correct incantation?&lt;/P&gt;</description>
    <pubDate>Thu, 31 Oct 2013 17:26:25 GMT</pubDate>
    <dc:creator>unclethan</dc:creator>
    <dc:date>2013-10-31T17:26:25Z</dc:date>
    <item>
      <title>Tokens in templates?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Tokens-in-templates/m-p/124440#M7316</link>
      <description>&lt;P&gt;I want to put a token into a panel-header and tried to use the token_safe filter as such:&lt;/P&gt;

&lt;P&gt;{% filter token_safe %} The selected pool is $selectedPool$ {% endfilter %}&lt;/P&gt;

&lt;P&gt;While this is valid in django (e.g. replace token_safe with lower), it is not translating my token. &lt;/P&gt;

&lt;P&gt;What is the correct incantation?&lt;/P&gt;</description>
      <pubDate>Thu, 31 Oct 2013 17:26:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Tokens-in-templates/m-p/124440#M7316</guid>
      <dc:creator>unclethan</dc:creator>
      <dc:date>2013-10-31T17:26:25Z</dc:date>
    </item>
    <item>
      <title>Re: Tokens in templates?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Tokens-in-templates/m-p/124441#M7317</link>
      <description>&lt;P&gt;Hello unclethan,&lt;/P&gt;

&lt;P&gt;If I am understanding your scenario correctly, it is not currently supported out of the box in the framework using just Django. We don't currently support token replacement of arbitrary html elements. We can put the feature in consideration for a future release. In the mean time, you can probably achieve the behavior you want using JavaScript to listen to changes in the token model and update your panel header manually. To do this you'd first put the part of your header that you'd like to update in an identifiable &lt;CODE&gt;&amp;lt;span&amp;gt;&lt;/CODE&gt; element--something like:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;{% filter %} The selected pool is &amp;lt;span id="filter"&amp;gt;Replaceable text&amp;lt;/span&amp;gt; {% endfilter %}
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Then, you'd listen to the token model in JavaScript and set the text of the span using JQuery when it changes:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;mvc.Components.getInstance("default").on("change:selectedPool", function(model, value, options) {
    $("#filter").text(value);
});
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;That code gets the &lt;CODE&gt;default&lt;/CODE&gt; token namespace, and listens to changes on the token called &lt;CODE&gt;selectedPool&lt;/CODE&gt;. Then it sets the text of the filter span to the value of the &lt;CODE&gt;selectedPool&lt;/CODE&gt; token. &lt;/P&gt;

&lt;P&gt;I hope that helps.&lt;/P&gt;</description>
      <pubDate>Thu, 31 Oct 2013 18:03:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Tokens-in-templates/m-p/124441#M7317</guid>
      <dc:creator>magnew_splunk</dc:creator>
      <dc:date>2013-10-31T18:03:33Z</dc:date>
    </item>
    <item>
      <title>Re: Tokens in templates?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Tokens-in-templates/m-p/124442#M7318</link>
      <description>&lt;P&gt;Thanks, this worked out.&lt;/P&gt;</description>
      <pubDate>Thu, 31 Oct 2013 21:39:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Tokens-in-templates/m-p/124442#M7318</guid>
      <dc:creator>unclethan</dc:creator>
      <dc:date>2013-10-31T21:39:54Z</dc:date>
    </item>
  </channel>
</rss>

