From b91c2c8ae35619c7da0e73039e38c87de15bd90c Mon Sep 17 00:00:00 2001
From: Wesley B <62723358+wesleyboar@users.noreply.github.com>
Date: Wed, 11 Mar 2026 18:32:40 -0500
Subject: [PATCH] feat: new settings for portal to serve/fetch nav
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
## Overview
Introduces 2 new settings —
* `PORTAL_HOSTS_NAV`
* `PORTAL_LOADS_NAV`
— to control and distinguish whether portal serves its own nav and/or loads CMS nav.
This change permits TUP-UI to serve a portal nav, while not loading CMS nav bits.
## Changes
- Updated `urls.py` to include conditions for rendering navigation based on the new settings.
- Modified `nav_portal.html` and `nav_portal.raw.html` templates to check for the new settings in addition to the existing `PORTAL_IS_TACC_CORE_PORTAL`.
- Added example configurations for the new settings in `settings_local.example.py`.
- Set default values for the new settings in `settings.py`.
## Testing
1. Verify that nav elements render correctly based on the new settings.
2. Ensure backward compatibility with existing configurations.
---
taccsite_cms/settings/settings.py | 4 ++++
taccsite_cms/settings/settings_local.example.py | 2 ++
taccsite_cms/templates/nav_portal.html | 9 ++++++---
taccsite_cms/templates/nav_portal.raw.html | 4 ++--
taccsite_cms/urls.py | 10 ++++++++--
5 files changed, 22 insertions(+), 7 deletions(-)
diff --git a/taccsite_cms/settings/settings.py b/taccsite_cms/settings/settings.py
index 2abb79537..fd2f46049 100644
--- a/taccsite_cms/settings/settings.py
+++ b/taccsite_cms/settings/settings.py
@@ -271,6 +271,8 @@ def gettext(s): return s
########################
PORTAL_IS_TACC_CORE_PORTAL = True
+PORTAL_HOSTS_NAV = True
+PORTAL_LOADS_NAV = True
PORTAL_HAS_LOGIN = True
PORTAL_HAS_SEARCH = True
PORTAL_LOGIN_PATH = '/login'
@@ -728,6 +730,8 @@ def get_subdirs_as_module_names(path):
'PORTAL_LOGO',
'PORTAL_FAVICON',
'PORTAL_IS_TACC_CORE_PORTAL',
+ 'PORTAL_HOSTS_NAV',
+ 'PORTAL_LOADS_NAV',
'PORTAL_HAS_LOGIN',
'PORTAL_LOGIN_PATH',
'PORTAL_HAS_SEARCH',
diff --git a/taccsite_cms/settings/settings_local.example.py b/taccsite_cms/settings/settings_local.example.py
index 87485e962..c904dff7a 100644
--- a/taccsite_cms/settings/settings_local.example.py
+++ b/taccsite_cms/settings/settings_local.example.py
@@ -31,4 +31,6 @@
# To disable the Core-Portal integration
# IMPORTANT: Do not disable by default, because [Core-Portal clones this file](https://github.com/TACC/Core-Portal/pull/1034)
# PORTAL_IS_TACC_CORE_PORTAL = False
+# PORTAL_HOSTS_NAV = False
+# PORTAL_LOADS_NAV = False
# PORTAL_HAS_LOGIN = False
diff --git a/taccsite_cms/templates/nav_portal.html b/taccsite_cms/templates/nav_portal.html
index 2c05f85d5..7d428ef04 100644
--- a/taccsite_cms/templates/nav_portal.html
+++ b/taccsite_cms/templates/nav_portal.html
@@ -9,14 +9,17 @@
-{% if settings.PORTAL_IS_TACC_CORE_PORTAL %}
-
+{% endif %}
+{% if settings.PORTAL_IS_TACC_CORE_PORTAL %}
+