<?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 Re: Adding a CSS and JavaScript source to an app's HTML Dashboard in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/Adding-a-CSS-and-JavaScript-source-to-an-app-s-HTML-Dashboard/m-p/126668#M7477</link>
    <description>&lt;P&gt;Just added info to the answer regarding how to link to images in your stylesheet.&lt;/P&gt;</description>
    <pubDate>Tue, 28 Jan 2014 18:49:15 GMT</pubDate>
    <dc:creator>LukeMurphey</dc:creator>
    <dc:date>2014-01-28T18:49:15Z</dc:date>
    <item>
      <title>Adding a CSS and JavaScript source to an app's HTML Dashboard</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Adding-a-CSS-and-JavaScript-source-to-an-app-s-HTML-Dashboard/m-p/126665#M7474</link>
      <description>&lt;P&gt;Hello all,&lt;/P&gt;

&lt;P&gt;I've looked around and have tried some other answers but are unable to have it functioning correctly. &lt;/P&gt;

&lt;P&gt;We're looking to add CSS and JavaScript to an app, however when we load our instance we are unable to load the source up, we've made sure the directory is correct, we've used the regular HTML expressions: &lt;/P&gt;

&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;STYLE href="https://community.splunk.com/etc"&gt;&amp;amp;amp;amp;amp;lt;/p&amp;amp;amp;amp;amp;gt;
&amp;amp;amp;amp;amp;lt;/blockquote&amp;amp;amp;amp;amp;gt;

&amp;amp;amp;amp;amp;lt;p&amp;amp;amp;amp;amp;gt;And have also tried: &amp;amp;amp;amp;amp;lt;/p&amp;amp;amp;amp;amp;gt;

&amp;amp;amp;amp;amp;lt;blockquote&amp;amp;amp;amp;amp;gt;
&amp;amp;amp;amp;amp;lt;p&amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;amp;lt;%def name =&amp;amp;amp;amp;amp;amp;quot;custom_css()&amp;amp;amp;amp;amp;amp;quot;&amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;lt;br&amp;amp;amp;amp;amp;gt;
        &amp;amp;amp;amp;amp;amp;lt;%lib:stylesheet_tags files=&amp;amp;amp;amp;amp;amp;quot;${[&amp;amp;amp;amp;amp;amp;#39;etc&amp;amp;amp;amp;amp;amp;#39;]}&amp;amp;amp;amp;amp;amp;quot;/&amp;amp;amp;amp;amp;amp;gt; &amp;amp;amp;amp;amp;amp;lt;/%def&amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;lt;/p&amp;amp;amp;amp;amp;gt;
&amp;amp;amp;amp;amp;lt;/blockquote&amp;amp;amp;amp;amp;gt;

&amp;amp;amp;amp;amp;lt;p&amp;amp;amp;amp;amp;gt;However, neither are working, we&amp;amp;amp;amp;amp;amp;#39;ve restarted SplunkWeb to see if that helped but still it produced nothing, the HTML file and the CSS and JS are in the same directory. We are also running Splunk 4.3.6.&amp;amp;amp;amp;amp;lt;/p&amp;amp;amp;amp;amp;gt;

&amp;amp;amp;amp;amp;lt;p&amp;amp;amp;amp;amp;gt;Thanks,&amp;amp;amp;amp;amp;lt;/p&amp;amp;amp;amp;amp;gt;
&amp;amp;amp;amp;amp;lt;/p&amp;amp;amp;amp;amp;gt;
&lt;/STYLE&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;</description>
      <pubDate>Mon, 28 Sep 2020 15:43:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Adding-a-CSS-and-JavaScript-source-to-an-app-s-HTML-Dashboard/m-p/126665#M7474</guid>
      <dc:creator>Jonathan_hyde</dc:creator>
      <dc:date>2020-09-28T15:43:40Z</dc:date>
    </item>
    <item>
      <title>Re: Adding a CSS and JavaScript source to an app's HTML Dashboard</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Adding-a-CSS-and-JavaScript-source-to-an-app-s-HTML-Dashboard/m-p/126666#M7475</link>
      <description>&lt;P&gt;Put the content in application.css and application.js accordingly. The paths are as follows:&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;$SPLUNK_HOME/etc/apps/&lt;YOUR_APP&gt;/appserver/static/application.js&lt;/YOUR_APP&gt;&lt;/LI&gt;
&lt;LI&gt;$SPLUNK_HOME/etc/apps/&lt;YOUR_APP&gt;/appserver/static/application.css&lt;/YOUR_APP&gt;&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;These files will be loaded for every page within your app context.&lt;/P&gt;

&lt;P&gt;You can put other resources (such as images) in the appserver/static directory too. Then, refer to them in the CSS using a relative path.&lt;/P&gt;

&lt;P&gt;Here is an example:&lt;BR /&gt;
Assume that an image named "picture.png" was placed in the following directory: &lt;/P&gt;

&lt;P&gt;$SPLUNK_HOME/etc/apps/&lt;YOUR_APP&gt;/appserver/static/images/picture.png&lt;/YOUR_APP&gt;&lt;/P&gt;

&lt;P&gt;You could reference this in your stylesheet like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;.somePicture {
    background-image: url('images/picture.png');
}
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 28 Sep 2020 15:43:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Adding-a-CSS-and-JavaScript-source-to-an-app-s-HTML-Dashboard/m-p/126666#M7475</guid>
      <dc:creator>LukeMurphey</dc:creator>
      <dc:date>2020-09-28T15:43:59Z</dc:date>
    </item>
    <item>
      <title>Re: Adding a CSS and JavaScript source to an app's HTML Dashboard</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Adding-a-CSS-and-JavaScript-source-to-an-app-s-HTML-Dashboard/m-p/126667#M7476</link>
      <description>&lt;P&gt;Brilliant it worked thanks, final question - do you know how to add images, as the css links to the images too? Thanks.&lt;/P&gt;</description>
      <pubDate>Tue, 28 Jan 2014 09:00:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Adding-a-CSS-and-JavaScript-source-to-an-app-s-HTML-Dashboard/m-p/126667#M7476</guid>
      <dc:creator>Jonathan_hyde</dc:creator>
      <dc:date>2014-01-28T09:00:28Z</dc:date>
    </item>
    <item>
      <title>Re: Adding a CSS and JavaScript source to an app's HTML Dashboard</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Adding-a-CSS-and-JavaScript-source-to-an-app-s-HTML-Dashboard/m-p/126668#M7477</link>
      <description>&lt;P&gt;Just added info to the answer regarding how to link to images in your stylesheet.&lt;/P&gt;</description>
      <pubDate>Tue, 28 Jan 2014 18:49:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Adding-a-CSS-and-JavaScript-source-to-an-app-s-HTML-Dashboard/m-p/126668#M7477</guid>
      <dc:creator>LukeMurphey</dc:creator>
      <dc:date>2014-01-28T18:49:15Z</dc:date>
    </item>
  </channel>
</rss>

