# HG changeset patch # User Thierry Florac # Date 1599489140 -7200 # Node ID 5bfb61ee72a8bb6725fc3a19e9a31631f9015f4c # Parent d3f9766fd25de9de9c6ef611e668e5bc0a28192b Added property to header renderer to get main navigation element class diff -r d3f9766fd25d -r 5bfb61ee72a8 src/pyams_default_theme/features/header/skin/__init__.py --- a/src/pyams_default_theme/features/header/skin/__init__.py Mon Jul 20 14:19:25 2020 +0200 +++ b/src/pyams_default_theme/features/header/skin/__init__.py Mon Sep 07 16:32:20 2020 +0200 @@ -10,8 +10,6 @@ # FOR A PARTICULAR PURPOSE. # -__docformat__ = 'restructuredtext' - import logging from pyramid.decorator import reify @@ -20,14 +18,13 @@ from pyams_cache.beaker import get_cache from pyams_content.component.association.interfaces import IAssociationInfo -from pyams_content.features.header.interfaces import IHeaderRenderer, IHeaderRendererSettings, IHeaderSettings, \ - IHeaderTarget +from pyams_content.features.header.interfaces import IHeaderRenderer, IHeaderRendererSettings, \ + IHeaderSettings, IHeaderTarget from pyams_content.features.renderer.interfaces import HIDDEN_RENDERER_NAME from pyams_content.root import ISiteRoot -from pyams_default_theme import _ from pyams_default_theme.features.header import SimpleHeaderRendererSettings from pyams_default_theme.features.header.interfaces import ISimpleHeaderRendererSettings -from pyams_default_theme.features.header.skin.interfaces import IHeaderClass +from pyams_default_theme.features.header.skin.interfaces import IHeaderClass, INavigationClass from pyams_default_theme.features.renderer import BaseContentRenderer from pyams_portal.interfaces import PREVIEW_MODE from pyams_portal.portlet import PORTLETS_CACHE_KEY, PORTLETS_CACHE_NAME, PORTLETS_CACHE_REGION @@ -40,6 +37,11 @@ from pyams_utils.traversing import get_parent +__docformat__ = 'restructuredtext' + +from pyams_default_theme import _ + + logger = logging.getLogger('PyAMS (content)') @@ -81,7 +83,14 @@ @property def main_header_class(self): request = self.request - return request.registry.queryMultiAdapter((request.context, request), IHeaderClass, default='') + return request.registry.queryMultiAdapter((request.context, request), IHeaderClass, + default='') + + @property + def main_navigation_class(self): + request = self.request + return request.registry.queryMultiAdapter((request.context, request), INavigationClass, + default='') @property def search_target(self): diff -r d3f9766fd25d -r 5bfb61ee72a8 src/pyams_default_theme/features/header/skin/interfaces.py --- a/src/pyams_default_theme/features/header/skin/interfaces.py Mon Jul 20 14:19:25 2020 +0200 +++ b/src/pyams_default_theme/features/header/skin/interfaces.py Mon Sep 07 16:32:20 2020 +0200 @@ -17,3 +17,7 @@ class IHeaderClass(Interface): """Custom header CSS class""" + + +class INavigationClass(Interface): + """Custom navigation CSS class""" diff -r d3f9766fd25d -r 5bfb61ee72a8 src/pyams_default_theme/features/header/skin/templates/simple-header.pt --- a/src/pyams_default_theme/features/header/skin/templates/simple-header.pt Mon Jul 20 14:19:25 2020 +0200 +++ b/src/pyams_default_theme/features/header/skin/templates/simple-header.pt Mon Sep 07 16:32:20 2020 +0200 @@ -1,9 +1,9 @@ -
-