GitHub user dosubot[bot] added a comment to the discussion: Changing 
LOGO_TARGET_PATH adds a 'Home' menu

<!-- Answer -->
To achieve your goal without hardcoding the URL in `/superset/views/base.py`, 
you can modify the `navbar.html` template to prevent the 'Home' menu from 
appearing and ensure the logo has the correct URL. Here's how:

1. **Prevent the 'Home' menu from appearing**: You can remove or comment out 
the code that generates the 'Home' menu in the `navbar.html` template. If the 
'Home' menu is part of the `appbuilder.menu`, you can customize the menu 
configuration in your Superset setup to exclude the 'Home' menu.

2. **Ensure the logo has the correct URL**: Set the `LOGO_TARGET_PATH` in your 
Superset configuration file (e.g., `superset_config.py`) to the desired URL. 
This way, you don't need to hardcode the URL in the template or disable 
`LOGO_TARGET_PATH`.

Here's an example of how you might configure `LOGO_TARGET_PATH` in 
`superset_config.py`:

```python
# superset_config.py
LOGO_TARGET_PATH = '/desired/path'
```

In the `navbar.html` template, the `root_path` is set using `LOGO_TARGET_PATH`:

```html
{% set root_path = logo_target_path if not logo_target_path.startswith('/') 
else '/superset' + logo_target_path if current_user.username is defined else 
'#' %}
```

By setting `LOGO_TARGET_PATH` in the configuration file, the `root_path` will 
automatically use this value, ensuring the logo points to the correct URL 
without hardcoding it in the template 
<sup>[[1]](https://github.com/apache/superset/blob/master/superset/templates/appbuilder/navbar.html)</sup>.


<!-- Dosu Comment Footer -->
*To continue talking to [Dosu](https://dosu.dev), mention @dosu.*

---
<sup>Help Dosu learn! Give it feedback: [Great 
Response](https://app.dosu.dev/response-feedback/23d8ffec-1cb7-476c-8699-43518f36e70f?feedback_type=great_response)
 | [Irrelevant 
Answer](https://app.dosu.dev/response-feedback/23d8ffec-1cb7-476c-8699-43518f36e70f?feedback_type=irrelevant_answer)
 | [Incorrect 
Sources](https://app.dosu.dev/response-feedback/23d8ffec-1cb7-476c-8699-43518f36e70f?feedback_type=incorrect_sources)
 | [Too 
Verbose](https://app.dosu.dev/response-feedback/23d8ffec-1cb7-476c-8699-43518f36e70f?feedback_type=too_verbose)
 | 
[Hallucination](https://app.dosu.dev/response-feedback/23d8ffec-1cb7-476c-8699-43518f36e70f?feedback_type=hallucination)
 | [Bug 
Report](https://app.dosu.dev/response-feedback/23d8ffec-1cb7-476c-8699-43518f36e70f?feedback_type=bug_report)
 | 
[Other](https://app.dosu.dev/response-feedback/23d8ffec-1cb7-476c-8699-43518f36e70f?feedback_type=other)</sup>


GitHub link: 
https://github.com/apache/superset/discussions/33295#discussioncomment-12990006

----
This is an automatically sent email for [email protected].
To unsubscribe, please send an email to: 
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to