Splunk Dev

Navigation bar on an app's homepage not loading correctly

erichar7
Explorer

I'm having some trouble with the navigation on my Splunk app that I'm working on. This is what the app's default.xml looks like

<nav color="#CCCC00">
    <view name="default" default="true"/>
    <a href="/dj/splenoss/home">Home</a>
    <a href="/dj/splenoss/monitoring">Monitoring</a>
    <a href="/dj/splenoss/monitor_input">Monitor Input</a>
</nav>

When I look at it from the Splunk homepage, everything looks correct and all of my links work. However, when I go to the app's homepage, my navigation bar is not populated with anything and is grey. It's almost as if it's not being loaded correctly. Here's the app's homepage HTML code:

{% extends "splunkdj:base_with_app_bar.html" %}
{% load splunkmvc %}


{% block title %}{{app_name}} Home Page{% endblock title %}

{% block css %}
    <link rel="stylesheet" type="text/css" href="{{STATIC_URL}}{{app_name}}/custom.css" />

    <style>        
        .main-area {
            margin: 0px auto;
            margin-top: 30px;
            margin-bottom: 30px;
            padding: 10px;
            width: 300px;
        }    
    </style>
{% endblock css %}

{% block content %}

    <div>
        <div class="main-area">
            <p>Template message: {{message}}</p>
            <p class="muted">You should also look in the JavaScript console...</p>
        </div>
    </div>

{% endblock content%}

{% block js %}    
    <script>
        console.log("Custom JavaScript Goes Here (look in your template)!");
    </script>
{% endblock js %}

I only started seeing this issue recently, specifically when I upgraded from Splunk 6.0 to Splunk 6.1. I've uninstalled Splunk completely and reinstalled in an attempt to fix the issue, but it didn't seem to do anything

What could cause the navigation menus to not work like this? This is a fresh install of Splunk 6.1, which has the web framework built right in, so am I doing something incorrect with my HTML code? I'm assuming I'm importing base_with_app_bar.html correctly? If anyone could point me in the right direction, that would be great!

0 Karma

gyslainlatsa
Motivator

it's just that you put a default view that does not function well and therefore it has blocked the other views to be displayed
modify your code as follows nav choosing to default = "true" as a parameter to a view that displays properly and removes the following line Home your code
and then check if your default dashboard for playing a horn. you will then code like this...

<nav color="#CCCC00">
    <view name="default" default="true"/>
    <a href="/dj/splenoss/monitoring">Monitoring</a>
    <a href="/dj/splenoss/monitor_input">Monitor Input</a>
</nav>

Here is a sample code I'm working on and it displays correctly and I set default = "true" as a parameter to a view that works properly

<nav>
    <view name="sequence_of_search_commands_clone" default="true"/>

    <a href="/dj/D3_project1_2010_10_06/sunburst">Sunburst</a>
    <a href="/dj/D3_project1_2010_10_06/calendar_view_of_count_by_Host">Calendar view of count by Host</a>
    <a href="/dj/D3_project1_2010_10_06/dashboard_question">dashboard_question</a>
    <view name="bubble_chart"/>
    <view name="stack_chart_with_overlay" />
    <view name="GANTT_CHART" />
</nav>

try it and let me know then.
second option, you can also change the default view and put a view of another application that works properly

0 Karma
Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...