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!

Introducing Splunk Enterprise 9.2

WATCH HERE! Watch this Tech Talk to learn about the latest features and enhancements shipped in the new Splunk ...

Adoption of RUM and APM at Splunk

    Unleash the power of Splunk Observability   Watch Now In this can't miss Tech Talk! The Splunk Growth ...

Routing logs with Splunk OTel Collector for Kubernetes

The Splunk Distribution of the OpenTelemetry (OTel) Collector is a product that provides a way to ingest ...