<?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: How to add CSS class to Navigation menu in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-add-CSS-class-to-Navigation-menu/m-p/59239#M3109</link>
    <description>&lt;P&gt;Sadly you can't do this, the reason anchors are passed through is so you can add links to other tools or resources. Adding classes isn't something that is supported without doing it through a bit of JS&lt;/P&gt;</description>
    <pubDate>Tue, 11 Jun 2013 10:52:17 GMT</pubDate>
    <dc:creator>Drainy</dc:creator>
    <dc:date>2013-06-11T10:52:17Z</dc:date>
    <item>
      <title>How to add CSS class to Navigation menu</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-add-CSS-class-to-Navigation-menu/m-p/59236#M3106</link>
      <description>&lt;P&gt;I would like to add CSS class to specific navigation menu elements (Not with Javascript, only by modifying navigation XML). In the example below, only to third element. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;nav&amp;gt;    
    &amp;lt;collection label="Views"&amp;gt;  
        &amp;lt;view name="first view"  default='true'/&amp;gt;
        &amp;lt;view name="second view"/&amp;gt;
        &amp;lt;a href="third view"&amp;gt;third view&amp;lt;/a&amp;gt;
    &amp;lt;/collection&amp;gt;
&amp;lt;/nav&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I understood that we can give "a" tag also inside navigation menu. (ref: &lt;A href="http://splunk-base.splunk.com/answers/71921/how-to-get-custom-name-in-navigation-menu"&gt;http://splunk-base.splunk.com/answers/71921/how-to-get-custom-name-in-navigation-menu&lt;/A&gt;). &lt;/P&gt;

&lt;P&gt;But If I try to give &lt;CODE&gt;"&amp;lt;a href="third view" class="myclass"&amp;gt;third view&amp;lt;/a&amp;gt;"&lt;/CODE&gt;, then I am not seeing "&lt;STRONG&gt;class="myclass"&lt;/STRONG&gt;" in DOM. Why class attribute is not rendering?&lt;/P&gt;</description>
      <pubDate>Tue, 11 Jun 2013 06:25:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-add-CSS-class-to-Navigation-menu/m-p/59236#M3106</guid>
      <dc:creator>kasu_praveen</dc:creator>
      <dc:date>2013-06-11T06:25:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to add CSS class to Navigation menu</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-add-CSS-class-to-Navigation-menu/m-p/59237#M3107</link>
      <description>&lt;P&gt;That other q&amp;amp;a only talks about anchor tags being carried through.&lt;/P&gt;

&lt;P&gt;If you want to add a class I'd do it with something like (Where Search is the displayed name of the dashboard I'm referencing);&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;$("li a:contains('Search')").addClass('myClassName');
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Wrap that in a document ready statement, plonk it in application.js for your application and restart (if you just created the .js).&lt;/P&gt;</description>
      <pubDate>Tue, 11 Jun 2013 07:53:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-add-CSS-class-to-Navigation-menu/m-p/59237#M3107</guid>
      <dc:creator>Drainy</dc:creator>
      <dc:date>2013-06-11T07:53:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to add CSS class to Navigation menu</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-add-CSS-class-to-Navigation-menu/m-p/59238#M3108</link>
      <description>&lt;P&gt;Thanks for the quick response Drainy.&lt;/P&gt;

&lt;P&gt;I was actually looking for adding class in navigation XML itself. Reason behind that is, Imagine,If my anchor element has class like "myclass", then I want to act on the element, something like below&lt;/P&gt;

&lt;P&gt;$(li a.myclass).text("blah blah");&lt;/P&gt;

&lt;P&gt;In the above line, I was modifying text of anchor link, which is having class "myclass". And in my case ":contains" may not workout, because most of my links contains same text. &lt;/P&gt;

&lt;P&gt;So I would like to differentiate anchor links/navigation links based on class name.&lt;/P&gt;</description>
      <pubDate>Tue, 11 Jun 2013 08:02:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-add-CSS-class-to-Navigation-menu/m-p/59238#M3108</guid>
      <dc:creator>kasu_praveen</dc:creator>
      <dc:date>2013-06-11T08:02:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to add CSS class to Navigation menu</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-add-CSS-class-to-Navigation-menu/m-p/59239#M3109</link>
      <description>&lt;P&gt;Sadly you can't do this, the reason anchors are passed through is so you can add links to other tools or resources. Adding classes isn't something that is supported without doing it through a bit of JS&lt;/P&gt;</description>
      <pubDate>Tue, 11 Jun 2013 10:52:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-add-CSS-class-to-Navigation-menu/m-p/59239#M3109</guid>
      <dc:creator>Drainy</dc:creator>
      <dc:date>2013-06-11T10:52:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to add CSS class to Navigation menu</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-add-CSS-class-to-Navigation-menu/m-p/59240#M3110</link>
      <description>&lt;P&gt;Ok, Thanks Drainy. I will think of some other way.&lt;/P&gt;</description>
      <pubDate>Tue, 11 Jun 2013 11:47:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-add-CSS-class-to-Navigation-menu/m-p/59240#M3110</guid>
      <dc:creator>kasu_praveen</dc:creator>
      <dc:date>2013-06-11T11:47:03Z</dc:date>
    </item>
  </channel>
</rss>

