Hi,
What would be the best/easiest way to add a button (or something) on a given dashboard that would go back to the Dashboard Menu (just a HTML dashboard that I've created)?
Do you mean the page that list all of the dashboards in the app?
If so, the easiest solution without adding custom HTML is to include the dashboard link in the navigation menu. If you include the following in your navigation menu (default.xml), you will "Dashboards" listed on the navigation bar,
<nav>
...
<view name="dashboards" />
...
</nav>
But, if you need HTML on the dashboard, you can fashion based on this in SimpleXML. Note the token $your_app_name$ is a stand-in for your applications name/id in splunk. The path for "dashboards" is relative to it.
<html>
<p>
<a class="backbutton" id="backbutton" href="/static/app/$your_app_name$/dashboards">
<img alt="Dashboads link" src="/static/app/$your_app_name$/backbutton.png"/>
</a>
</p>
</html>
Do you mean the page that list all of the dashboards in the app?
If so, the easiest solution without adding custom HTML is to include the dashboard link in the navigation menu. If you include the following in your navigation menu (default.xml), you will "Dashboards" listed on the navigation bar,
<nav>
...
<view name="dashboards" />
...
</nav>
But, if you need HTML on the dashboard, you can fashion based on this in SimpleXML. Note the token $your_app_name$ is a stand-in for your applications name/id in splunk. The path for "dashboards" is relative to it.
<html>
<p>
<a class="backbutton" id="backbutton" href="/static/app/$your_app_name$/dashboards">
<img alt="Dashboads link" src="/static/app/$your_app_name$/backbutton.png"/>
</a>
</p>
</html>
Hmmmm maybe... Not quite sure I understand.....
Lemme add some additional detail....
I have a HTML dashboard that is a Dashboard Menu where a number of dashboards are listed (a href="dashboard name" type of format), when you click on one it will take you to that dashboard. When the user is done with that dashboard and wants to go back to the Dashboard Menu there isn't an easy way to do that. Does that help?
OK, assuming you are not doing anything to alter the history, you should be able to go back in the history with something like this.
<button type="button" onclick="javascript:history.back()">Back</button>
Hi Rjthibod,
Thanks! This sounds like what I'm looking for, but, I'm not quite sure how to go about using it?
Would you mind providing a sample? Sorry for the newbie question 🙂
You should be able to insert this element in an existing container or <div>
element unless you are doing something very odd. IYou will need to share some of your html if you need more help.
<div>
...
<button id="backBtn" name="backBtn" class="btn btn-primary" onclick="javascript:history.back()"><span>Back to Dashboards</span></button>
...
</div>
well the Dashboard menu (where you start) is HTML, the dashboard that the menu calls is XML which is where the button needs to go
I ended up taking your solution and modifying it a bit, it looks like this now
<html>
<h1>
<p>
<a href="https://icontrol.splunkcloud.com/en-US/app/search/dashboard_of_dashboards"><div align="right">Return to the Dashboard Menu</div></a><br/></br>
</p>
</h1>
</html>
Great. Glad it was successful.
Where on the Simple XML do you want the button?
Without using JavaScript, you can only insert a raw HTML element inside a <panel>
element.
I ended up putting it here
<form refresh="0">
<label>Beta Reports - Summary</label>
<fieldset submitButton="false" autoRun="true">
<html>
<h1>
<p>
<a href="https://icontrol.splunkcloud.com/en-US/app/search/dashboard_of_dashboards"><div align="right">Return to the Dashboard Menu</div></a><br/></br>
</p>
</h1>
</html>
<input type="time" token="field1" searchWhenChanged="true">
<label>Select a Time Period</label>
<default>
<earliest>-6h</earliest>
<latest>now</latest>
</default>
</input>
The header is ignored but thats ok, I'll just change the font size
No problem. Give me a few secs.
P.S. Am I correct to think your avatar suggest you are a student/alum/employee of Clemson?
🙂 . 86 Grad (now I'm old too 🙂 )
Go tigers. I'm an adopted fan. Soon to be wife and family are alums/fans.
Congrats! Adopted fans are great!