diff --git a/index.php b/index.php index 08123c15b343b2520478eb5d0a4eeec5eda01811..072e27b19fdf6881616592a61870590467bcbd8c 100644 --- a/index.php +++ b/index.php @@ -18,23 +18,32 @@ /** * Menu */ -$homeLink = false; -$homeLinkText = false; +$menuParams = [ + 'showStart' => false, + 'data-show-button-on-desktop' => 1, + 'Project' => $Site->getProject() +]; if (isset($templateSettings['homeLink']) && $templateSettings['homeLink']) { - $homeLink = true; + $menuParams['showStart'] = true; } if (isset($templateSettings['homeLinkText']) && $templateSettings['homeLinkText'] !== '') { - $homeLinkText = $templateSettings['homeLinkText']; + $menuParams['startText'] = $templateSettings['homeLinkText']; } -$Menu = new QUI\Menu\MegaMenu([ - 'showStart' => $homeLink, - 'startText' => $homeLinkText, - 'data-show-button-on-desktop' => 1, - 'Project' => $Site->getProject() -]); +if ($Project->getConfig('templateCologne.settings.enableIndependentMenu') && $Project->getConfig('templateCologne.settings.menuId')) { + $menuParams['menuId'] = $Project->getConfig('templateCologne.settings.menuId'); + $menuParams['showFirstLevelIcons'] = $Project->getConfig('templateCologne.settings.showFirstLevelIcons'); + $menuParams['showStart'] = false; +} + +// Site own / independent menu +if ($Site->getAttribute('templateCologne.independentMenuId')) { + $menuParams['menuId'] = $Site->getAttribute('templateCologne.independentMenuId'); +} + +$Menu = new QUI\Menu\MegaMenu($menuParams); /** * Basket button diff --git a/locale.xml b/locale.xml index 469670856ff03357482747e38b055a46b28a393e..a253f451b7a35e67349bcfcc6dc6319001053ba2 100644 --- a/locale.xml +++ b/locale.xml @@ -266,10 +266,17 @@ <en><![CDATA[CSS class]]></en> </locale> <locale name="siteSettings.pageCustomClass.desc" html="true"> - <de><![CDATA[<strong>Für Entwickler:</strong> man kann einer Seite separate CSS Klasse geben. Diese wird auf das <i><body></i> Tag gesetzt. Somit kann man die Seite nicht nur per ID ansprechen. Es ist hilfreich, wenn z.B. Live und Dev Umgebung existeirt (oder auch lokale Installation), die nicht exakt gleich sind.<br> - Die CSS klasse wird so aufgebaut: <code>templateCologne__deine-css-klasse</code>]]></de> - <en><![CDATA[<strong>For developers:</strong> you can give a page a separate CSS class. This is set on the <i><body></i> tag. This way you can address the page not only by ID. It is helpful if e.g. Live and Dev environment exist (or local installation), which are not exactly the same.<br> - The CSS class looks like this: <code>templateCologne__your-css-class</code>]]></en> + <de><![CDATA[<strong>Für Entwickler:</strong> man kann einer Seite separate CSS Klasse geben. Diese wird auf das <i><body></i> Tag gesetzt. Somit kann man die Seite nicht nur per ID ansprechen. Es ist hilfreich, wenn z.B. Live und Dev Umgebung existeirt (oder auch lokale Installation), die nicht exakt gleich sind.]]></de> + <en><![CDATA[<strong>For developers:</strong> you can give a page a separate CSS class. This is set on the <i><body></i> tag. This way you can address the page not only by ID. It is helpful if e.g. Live and Dev environment exist (or local installation), which are not exactly the same.]]></en> + </locale> + + <locale name="siteSettings.independentMenuId"> + <de><![CDATA[Eigenes Menü]]></de> + <en><![CDATA[Independent]]></en> + </locale> + <locale name="siteSettings.independentMenuId.desc"> + <de><![CDATA[Die Option ermöglichst separates und unabhängiges Menü für eine einzelne Seite zu setzen.]]></de> + <en><![CDATA[The option allows to set separate and independent menu for single page.]]></en> </locale> <!-- template settings --> @@ -476,6 +483,28 @@ If you check this box, the menu will be detached from the top and initial placed <strong>only when you reach the initial position of the menu (in most cases when you scroll all the way up)</strong>.]]></en> </locale> + <!-- nav / menu: independent --> + <locale name="templateCologne.settings.independentMenu.title"> + <de><![CDATA[Eigenes Menü]]></de> + <en><![CDATA[Independent menu]]></en> + </locale> + <locale name="settings.independentMenu.enableIndependentMenu"> + <de><![CDATA[Eigenes Menü aktivieren]]></de> + <en><![CDATA[Enable independent menu]]></en> + </locale> + <locale name="settings.independentMenu.menuId"> + <de><![CDATA[Menü auswählen]]></de> + <en><![CDATA[Select menu]]></en> + </locale> + <locale name="settings.independentMenu.menuId.desc"> + <de><![CDATA[Wenn ein eigenes Menü ausgewählt ist, wird dieses als Navigation angezeigt.]]></de> + <en><![CDATA[If a custom (independent) menu is selected, this will be displayed as navigation.]]></en> + </locale> + <locale name="settings.independentMenu.showFirstLevelIcons"> + <de><![CDATA[Icons in der erster Ebene anzeigen]]></de> + <en><![CDATA[Show icons in the first level]]></en> + </locale> + <!-- header settings --> <locale name="settings.header.title"> <de><![CDATA[Header Einstellungen]]></de> diff --git a/settings.xml b/settings.xml index 2f3e4487ae994682a6674e762dfff02a8fe34ae4..9115bcda8c0f995a5bccfcce33c8b4754a2480a2 100644 --- a/settings.xml +++ b/settings.xml @@ -79,6 +79,18 @@ <defaultvalue>false</defaultvalue> </conf> + <!-- nav / menu: independent --> + <conf name="enableIndependentMenu"> + <type><![CDATA[bool]]></type> + </conf> + <conf name="menuId"> + <type><![CDATA[integer]]></type> + </conf> + <conf name="showFirstLevelIcons"> + <type><![CDATA[bool]]></type> + <defaultvalue>0</defaultvalue> + </conf> + <!-- header --> <conf name="headerStartPage"> <type><![CDATA[string]]></type> @@ -534,6 +546,50 @@ </input> </settings> + <!-- Nav / menu: independent --> + <settings title="templateCologne.settings" + name="settings.independentMenu.title"> + <title> + <locale group="quiqqer/template-cologne" + var="templateCologne.settings.independentMenu.title" + /> + </title> + + <input conf="templateCologne.settings.enableIndependentMenu" + type="checkbox"> + <text> + <locale group="quiqqer/template-cologne" + var="settings.independentMenu.enableIndependentMenu" + /> + </text> + </input> + + <input conf="templateCologne.settings.menuId" + type="text" + data-qui="package/quiqqer/menu/bin/Controls/Independent/Input"> + <text> + <locale group="quiqqer/template-cologne" + var="settings.independentMenu.menuId" + /> + </text> + + <description> + <locale group="quiqqer/template-cologne" + var="settings.independentMenu.menuId.desc" + /> + </description> + </input> + + <input conf="templateCologne.settings.showFirstLevelIcons" + type="checkbox"> + <text> + <locale group="quiqqer/template-cologne" + var="settings.independentMenu.showFirstLevelIcons" + /> + </text> + </input> + </settings> + <!-- header --> <settings title="templateCologne.settings" name="templateCologne.breadcrumb.settings"> diff --git a/site.xml b/site.xml index 6d84b86b75b1b3f31bc8eeff7477ccc226c99f9a..f29ac910aa3a8bcee51fda5ac0da308eec4cdcef 100644 --- a/site.xml +++ b/site.xml @@ -6,6 +6,7 @@ <attribute>templateCologne.header</attribute> <attribute>templateCologne.largeSpacing</attribute> <attribute>templateCologne.pageCustomClass</attribute> + <attribute>templateCologne.independentMenuId</attribute> </attributes> <settings> @@ -63,6 +64,23 @@ var="siteSettings.pageCustomClass.desc"/> </description> </input> + + <!-- Independent mnenu / own menu --> + <input conf="templateCologne.independentMenuId" + type="text" + data-qui="package/quiqqer/menu/bin/Controls/Independent/Input"> + <text> + <locale group="quiqqer/template-cologne" + var="siteSettings.independentMenuId" + /> + </text> + + <description> + <locale group="quiqqer/template-cologne" + var="siteSettings.independentMenuId.desc" + /> + </description> + </input> </settings> </category> </settings>