All Apps and Add-ons

How do I add an image in a menu?

jip31
Motivator

Hi

I want to add an image in a menu.

is this a good way???

<collection label="Benchmarking">
  <a href="/app/FO_Benchmark_McAFEE_Monitoring">FO_Benchmark</a><img src="/static/test.png"></img>
</collection>

Thanks

Tags (1)
0 Karma
1 Solution

martin_mueller
SplunkTrust
SplunkTrust

The nav XML schema does not allow arbitrary HTML. See $SPLUNK_HOME/share/splunk/search_mrsparkle/exposed/schema/nav.rnc for the schema file. I've put a copy at the bottom.

You may be able to build your own slightly-hacky JS-based image inserter, but be wary of UI updates with Splunk version upgrades , supportability, and possibly breaking other stuff.

##
## Splunk app view navgation RelaxNG schema
##

start = Nav

Nav = element nav { 
    attribute color { text }?
    & attribute search_view { text }?
    & NavItem*
}

NavItem = ( Saved | View | Collection | Divider | A )

Collection = element collection {
    attribute label { text }
    & Saved*
    & View*
    & Collection*
    & Divider*
    & A*
}

Saved = element saved {
    (
        attribute name { text }
        | (
            attribute source { "all" | "unclassified" }
            & attribute match { text }?
        )
    )
    & attribute view { text }?
}

View = element view {
    (
        attribute name { text }
        | (
            attribute source { "all" | "unclassified" }
            & attribute match { text }?
        )
    )
    & attribute default { text }?
}

A = element a {
    attribute href { text }
    & attribute target { text }?
    & text
}

Divider = element divider { empty }

View solution in original post

0 Karma

martin_mueller
SplunkTrust
SplunkTrust

The nav XML schema does not allow arbitrary HTML. See $SPLUNK_HOME/share/splunk/search_mrsparkle/exposed/schema/nav.rnc for the schema file. I've put a copy at the bottom.

You may be able to build your own slightly-hacky JS-based image inserter, but be wary of UI updates with Splunk version upgrades , supportability, and possibly breaking other stuff.

##
## Splunk app view navgation RelaxNG schema
##

start = Nav

Nav = element nav { 
    attribute color { text }?
    & attribute search_view { text }?
    & NavItem*
}

NavItem = ( Saved | View | Collection | Divider | A )

Collection = element collection {
    attribute label { text }
    & Saved*
    & View*
    & Collection*
    & Divider*
    & A*
}

Saved = element saved {
    (
        attribute name { text }
        | (
            attribute source { "all" | "unclassified" }
            & attribute match { text }?
        )
    )
    & attribute view { text }?
}

View = element view {
    (
        attribute name { text }
        | (
            attribute source { "all" | "unclassified" }
            & attribute match { text }?
        )
    )
    & attribute default { text }?
}

A = element a {
    attribute href { text }
    & attribute target { text }?
    & text
}

Divider = element divider { empty }
0 Karma

niketn
Legend

@jip31, while this might not be possible with Splunk's built in Navigation XML. You can create a pre-built panel with your own menu which can be customized as per your needs and used in all your dashboards after hiding Splunk's Navigation. Refer to an older answer of mine to go through the overview of the required steps: https://answers.splunk.com/answers/595047/can-we-implement-cascading-dropdowns-in-a-dashboar.html

____________________________________________
| makeresults | eval message= "Happy Splunking!!!"
0 Karma

jip31
Motivator

OK thanks

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Can’t Make It to Boston? Stream .conf25 and Learn with Haya Husain

Boston may be buzzing this September with Splunk University and .conf25, but you don’t have to pack a bag to ...

Splunk Lantern’s Guide to The Most Popular .conf25 Sessions

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

Unlock What’s Next: The Splunk Cloud Platform at .conf25

In just a few days, Boston will be buzzing as the Splunk team and thousands of community members come together ...