Dashboards & Visualizations

LayoutPanel name for Help | About menu section

Ant1D
Motivator

Hey,

I want to place a HTML link in the position where the Help | About menu resides in Splunk Web.

Does anyone know the layoutPanel value (e.g. appHeader) that will make this possible?

Also does anyone know where I can get a list of all of the layoutPanel positions that I can use in Advanced XML? This will be useful for positioning modules in a view.

Thanks in advance for your help.

0 Karma
1 Solution

ziegfried
Influencer

That sould be navigationHeader. You can take a look at the (mako-) template that renderes the view at $SPLUNK_HOME/share/splunk/search_mrsparkle/view/dashboard.html and $SPLUNK_HOME/share/splunk/search_mrsparkle/view/search.html (search form).

Available regions for a dashboard (might not be complete):

  • appHeader
  • navigationHeader
  • viewHeader
  • splSearchControls-inline
  • mainSearchControls
  • panel_row{n}_col{n}[_grp{n}]


One option to position the content to the right of the Help | About Links is to add it before the AppBar:

<module name="StaticContentSample" layoutPanel="navigationHeader">
    <param name="text"><![CDATA[ <span>|</span><a href="#"> Test</a> ]]></param>
</module>
<module name="AppBar" layoutPanel="navigationHeader"/>

and set the CSS (application.css) to float right:

.navigationHeader .StaticContentSample { float: right; }

Tweaking the padding/margin in the CSS might help in positioning it.


An easier option as well, is to just use JS to add the link to the menu. In application.js:

$('<a href="#">Test</a> <span>|</span>').prependTo(".AppBar .auxLinks");

or

$('<span>|</span> <a href="#">Test</a>').appendTo(".AppBar .auxLinks");

If you only want to do this in one view, you can do this by surround this statements with something like:

if($('body.splView-flashtimeline').length) { ... }

View solution in original post

ziegfried
Influencer

That sould be navigationHeader. You can take a look at the (mako-) template that renderes the view at $SPLUNK_HOME/share/splunk/search_mrsparkle/view/dashboard.html and $SPLUNK_HOME/share/splunk/search_mrsparkle/view/search.html (search form).

Available regions for a dashboard (might not be complete):

  • appHeader
  • navigationHeader
  • viewHeader
  • splSearchControls-inline
  • mainSearchControls
  • panel_row{n}_col{n}[_grp{n}]


One option to position the content to the right of the Help | About Links is to add it before the AppBar:

<module name="StaticContentSample" layoutPanel="navigationHeader">
    <param name="text"><![CDATA[ <span>|</span><a href="#"> Test</a> ]]></param>
</module>
<module name="AppBar" layoutPanel="navigationHeader"/>

and set the CSS (application.css) to float right:

.navigationHeader .StaticContentSample { float: right; }

Tweaking the padding/margin in the CSS might help in positioning it.


An easier option as well, is to just use JS to add the link to the menu. In application.js:

$('<a href="#">Test</a> <span>|</span>').prependTo(".AppBar .auxLinks");

or

$('<span>|</span> <a href="#">Test</a>').appendTo(".AppBar .auxLinks");

If you only want to do this in one view, you can do this by surround this statements with something like:

if($('body.splView-flashtimeline').length) { ... }

Ant1D
Motivator

Thanks for the JS info. I might give it a try. Thanks for the different options.

0 Karma

Ant1D
Motivator

It works! but I am not surprised. Clever thinking as usual from yourself. Thanks again.

0 Karma

ziegfried
Influencer

Modified answer

Ant1D
Motivator

Hi Ziegfried. Thanks for the info. I tried navigationHeader before but it puts my link just below the menu bar. Is there a (simple) way of positioning the module so that it appears on the right hand side and not the left?

0 Karma
Get Updates on the Splunk Community!

Built-in Service Level Objectives Management to Bridge the Gap Between Service & ...

Wednesday, May 29, 2024  |  11AM PST / 2PM ESTRegister now and join us to learn more about how you can ...

Get Your Exclusive Splunk Certified Cybersecurity Defense Engineer at Splunk .conf24 ...

We’re excited to announce a new Splunk certification exam being released at .conf24! If you’re headed to Vegas ...

Share Your Ideas & Meet the Lantern team at .Conf! Plus All of This Month’s New ...

Splunk Lantern is Splunk’s customer success center that provides advice from Splunk experts on valuable data ...