Initial Commit

This commit is contained in:
2019-11-21 12:25:31 +01:00
commit f4aabcb9b1
13959 changed files with 787761 additions and 0 deletions

View File

@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<config xmlns="http://thelia.net/schema/dic/config" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://thelia.net/schema/dic/config http://thelia.net/schema/dic/config/thelia-1.0.xsd">
<loops>
</loops>
<forms>
<form name="hooknavigation.configuration" class="HookNavigation\Form\HookNavigationConfigForm" />
</forms>
<commands>
</commands>
<hooks>
<hook id="hooknavigation.hook.front" class="HookNavigation\Hook\FrontHook">
<tag name="hook.event_listener" event="main.navbar-primary" templates="render:main-navbar-primary.html" />
<tag name="hook.event_listener" event="main.footer-bottom" type="front" active="1" method="onMainFooterBottom" />
<tag name="hook.event_listener" event="main.footer-body" type="front" active="1" method="onMainFooterBody" />
</hook>
</hooks>
</config>

View File

@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<module xmlns="http://thelia.net/schema/dic/module"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://thelia.net/schema/dic/module http://thelia.net/schema/dic/module/module-2_1.xsd">
<fullnamespace>HookNavigation\HookNavigation</fullnamespace>
<descriptive locale="en_US">
<title>Block Navigation</title>
</descriptive>
<descriptive locale="fr_FR">
<title>Bloc Menu</title>
</descriptive>
<languages>
<language>en_US</language>
<language>fr_FR</language>
</languages>
<version>2.3.1</version>
<author>
<name>Julien Chanséaume</name>
<email>jchanseaume@openstudio.fr</email>
</author>
<type>classic</type>
<thelia>2.2.0</thelia>
<stability>alpha</stability>
</module>

View File

@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<routes xmlns="http://symfony.com/schema/routing" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://symfony.com/schema/routing http://symfony.com/schema/routing/routing-1.0.xsd">
<route id="hooknavigation.configuration.default" path="/admin/module/HookNavigation" methods="get">
<default key="_controller">HookNavigation:HookNavigationConfig:default</default>
</route>
<route id="hooknavigation.configuration.save" path="/admin/module/HookNavigation" methods="post">
<default key="_controller">HookNavigation:HookNavigationConfig:save</default>
</route>
</routes>

View File

@@ -0,0 +1,75 @@
<?php
/*************************************************************************************/
/* This file is part of the Thelia package. */
/* */
/* Copyright (c) OpenStudio */
/* email : dev@thelia.net */
/* web : http://www.thelia.net */
/* */
/* For the full copyright and license information, please view the LICENSE.txt */
/* file that was distributed with this source code. */
/*************************************************************************************/
namespace HookNavigation\Controller;
use HookNavigation\HookNavigation;
use HookNavigation\Model\Config\HookNavigationConfigValue;
use Thelia\Controller\Admin\BaseAdminController;
use Thelia\Form\Exception\FormValidationException;
/**
* Class HookNavigationConfigController.
*
* @author Etienne PERRIERE <eperriere@openstudio.fr> - OpenStudio
*/
class HookNavigationConfigController extends BaseAdminController
{
public function defaultAction()
{
$bodyConfig = HookNavigation::getConfigValue(HookNavigationConfigValue::FOOTER_BODY_FOLDER_ID);
$bottomConfig = HookNavigation::getConfigValue(HookNavigationConfigValue::FOOTER_BOTTOM_FOLDER_ID);
$this->getSession()->getFlashBag()->set('bodyConfig', $bodyConfig);
$this->getSession()->getFlashBag()->set('bottomConfig', $bottomConfig);
return $this->render('hooknavigation-configuration');
}
public function saveAction()
{
$baseForm = $this->createForm('hooknavigation.configuration');
$errorMessage = null;
try {
$form = $this->validateForm($baseForm);
$data = $form->getData();
HookNavigation::setConfigValue(HookNavigationConfigValue::FOOTER_BODY_FOLDER_ID, is_bool($data['footer_body_folder_id']) ? (int) ($data['footer_body_folder_id']) : $data['footer_body_folder_id']);
HookNavigation::setConfigValue(HookNavigationConfigValue::FOOTER_BOTTOM_FOLDER_ID, is_bool($data['footer_bottom_folder_id']) ? (int) ($data['footer_bottom_folder_id']) : $data['footer_bottom_folder_id']);
} catch (FormValidationException $ex) {
// Invalid data entered
$errorMessage = $this->createStandardFormValidationErrorMessage($ex);
} catch (\Exception $ex) {
// Any other error
$errorMessage = $this->getTranslator()->trans('Sorry, an error occurred: %err', ['%err' => $ex->getMessage()], [], HookNavigation::MESSAGE_DOMAIN);
}
if (null !== $errorMessage) {
// Mark the form as with error
$baseForm->setErrorMessage($errorMessage);
// Send the form and the error to the parser
$this->getParserContext()
->addForm($baseForm)
->setGeneralError($errorMessage)
;
} else {
$this->getParserContext()
->set('success', true)
;
}
return $this->defaultAction();
}
}

View File

@@ -0,0 +1,55 @@
<?php
/*************************************************************************************/
/* This file is part of the Thelia package. */
/* */
/* Copyright (c) OpenStudio */
/* email : dev@thelia.net */
/* web : http://www.thelia.net */
/* */
/* For the full copyright and license information, please view the LICENSE.txt */
/* file that was distributed with this source code. */
/*************************************************************************************/
namespace HookNavigation\Form;
use HookNavigation\HookNavigation;
use Symfony\Component\Validator\Constraints\NotBlank;
use Thelia\Form\BaseForm;
/**
* Class HookNavigationConfigForm.
*
* @author Etienne PERRIERE <eperriere@openstudio.fr> - OpenStudio
*/
class HookNavigationConfigForm extends BaseForm
{
public function getName()
{
return 'hooknavigation_configuration';
}
protected function buildForm()
{
$this->formBuilder
->add(
'footer_body_folder_id',
'number',
[
'constraints' => [
new NotBlank(),
],
'label' => $this->translator->trans('Folder in footer body', [], HookNavigation::MESSAGE_DOMAIN),
]
)
->add(
'footer_bottom_folder_id',
'number',
[
'constraints' => [
new NotBlank(),
],
'label' => $this->translator->trans('Folder in footer bottom', [], HookNavigation::MESSAGE_DOMAIN),
]
);
}
}

View File

@@ -0,0 +1,51 @@
<?php
/*************************************************************************************/
/* This file is part of the Thelia package. */
/* */
/* Copyright (c) OpenStudio */
/* email : dev@thelia.net */
/* web : http://www.thelia.net */
/* */
/* For the full copyright and license information, please view the LICENSE.txt */
/* file that was distributed with this source code. */
/*************************************************************************************/
namespace HookNavigation\Hook;
use HookNavigation\HookNavigation;
use HookNavigation\Model\Config\HookNavigationConfigValue;
use Thelia\Core\Event\Hook\HookRenderBlockEvent;
use Thelia\Core\Event\Hook\HookRenderEvent;
use Thelia\Core\Hook\BaseHook;
/**
* Class FrontHook.
*
* @author Julien Chanséaume <jchanseaume@openstudio.fr>, Etienne PERRIERE <eperriere@openstudio.fr> - OpenStudio
*/
class FrontHook extends BaseHook
{
public function onMainFooterBody(HookRenderBlockEvent $event)
{
$bodyConfig = HookNavigation::getConfigValue(HookNavigationConfigValue::FOOTER_BODY_FOLDER_ID);
$content = trim($this->render('main-footer-body.html', ['bodyFolderId' => $bodyConfig]));
if ('' != $content) {
$event->add(array(
'id' => 'navigation-footer-body',
'class' => 'links',
'title' => $this->trans('Latest articles', array(), HookNavigation::MESSAGE_DOMAIN),
'content' => $content,
));
}
}
public function onMainFooterBottom(HookRenderEvent $event)
{
$bottomConfig = HookNavigation::getConfigValue(HookNavigationConfigValue::FOOTER_BOTTOM_FOLDER_ID);
$content = $this->render('main-footer-bottom.html', ['bottomFolderId' => $bottomConfig]);
$event->add($content);
}
}

View File

@@ -0,0 +1,24 @@
<?php
/*************************************************************************************/
/* This file is part of the Thelia package. */
/* */
/* Copyright (c) OpenStudio */
/* email : dev@thelia.net */
/* web : http://www.thelia.net */
/* */
/* For the full copyright and license information, please view the LICENSE.txt */
/* file that was distributed with this source code. */
/*************************************************************************************/
namespace HookNavigation;
use Thelia\Module\BaseModule;
/**
* Class HookNavigation.
*/
class HookNavigation extends BaseModule
{
const MESSAGE_DOMAIN = 'hooknavigation';
const ROUTER = 'router.hooknavigation';
}

View File

@@ -0,0 +1,11 @@
<?php
return [
'Categories' => 'Kategorien',
'Folder in footer body' => 'Ordner in Fußzeile',
'Folder in footer bottom' => 'Ordner in Fußzeile',
'Home' => 'Startseite',
'HookNavigation configuration' => 'HookNavigation Konfiguration',
'No articles currently' => 'Zur Zeit keine Artikel',
'Toggle navigation' => 'Navigation umschalten',
];

View File

@@ -0,0 +1,10 @@
<?php
return array(
'Configuration correctly saved' => 'Configuration correctly saved',
'Configure hooknavigation' => 'Configure hooknavigation',
'Home' => 'Home',
'HookNavigation configuration' => 'HookNavigation configuration',
'Modules' => 'Modules',
'Select a folder' => 'Select a folder',
);

View File

@@ -0,0 +1,10 @@
<?php
return [
'Configuration correctly saved' => 'Configuration sauvegardée correctement',
'Configure hooknavigation' => 'Configurer Bloc Menu',
'Home' => 'Accueil',
'HookNavigation configuration' => 'Configuration de Block Menu',
'Modules' => 'Modules',
'Select a folder' => 'Sélectionner un dossier',
];

View File

@@ -0,0 +1,7 @@
<?php
return [
'Home' => 'Home',
'Modules' => 'Moduli',
'Select a folder' => 'Seleziona una cartella',
];

View File

@@ -0,0 +1,11 @@
<?php
return [
'Categories' => 'Katogoriler',
'Folder in footer body' => 'Altbilgi vücut klasöründe',
'Folder in footer bottom' => 'Altbilgi alt klasöründe',
'Home' => 'Ana sayfa',
'HookNavigation configuration' => 'HookNavigation yapılandırma',
'No articles currently' => 'Hiç makale yok',
'Toggle navigation' => 'Navigasyonu değiştir',
];

View File

@@ -0,0 +1,8 @@
<?php
return array(
'Folder in footer body' => 'Folder in footer body',
'Folder in footer bottom' => 'Folder in footer bottom',
'Latest articles' => 'Latest articles',
'Sorry, an error occurred: %err' => 'Sorry, an error occurred: %err',
);

View File

@@ -0,0 +1,8 @@
<?php
return [
'Folder in footer body' => 'Dossier du pied de page',
'Folder in footer bottom' => 'Dossier sous le pied de page',
'Latest articles' => 'Nos dossiers',
'Sorry, an error occurred: %err' => 'Désolé, une erreur est survenue: %err',
];

View File

@@ -0,0 +1,6 @@
<?php
return [
'Latest articles' => 'Neueste Artikel',
'No articles currently' => 'Zur Zeit keine Artikel',
];

View File

@@ -0,0 +1,8 @@
<?php
return array(
'Categories' => 'Categories',
'Home' => 'Home',
'No articles currently' => 'No articles currently',
'Toggle navigation' => 'Toggle navigation',
);

View File

@@ -0,0 +1,8 @@
<?php
return [
'Categories' => 'Rubriques',
'Home' => 'Accueil',
'No articles currently' => 'Aucun article pour le moment',
'Toggle navigation' => 'Basculer la navigation',
];

View File

@@ -0,0 +1,8 @@
<?php
return [
'Categories' => 'Categorie',
'Home' => 'Home',
'No articles currently' => 'Attualmente non sono presenti articoli',
'Toggle navigation' => 'Toggle navigation',
];

View File

@@ -0,0 +1,6 @@
<?php
return [
'Latest articles' => 'Son Makaleler',
'No articles currently' => 'Hiç makale yok',
];

View File

@@ -0,0 +1,5 @@
<?php
return [
'Latest articles' => 'Ultimi articoli',
];

View File

@@ -0,0 +1,165 @@
GNU LESSER GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
This version of the GNU Lesser General Public License incorporates
the terms and conditions of version 3 of the GNU General Public
License, supplemented by the additional permissions listed below.
0. Additional Definitions.
As used herein, "this License" refers to version 3 of the GNU Lesser
General Public License, and the "GNU GPL" refers to version 3 of the GNU
General Public License.
"The Library" refers to a covered work governed by this License,
other than an Application or a Combined Work as defined below.
An "Application" is any work that makes use of an interface provided
by the Library, but which is not otherwise based on the Library.
Defining a subclass of a class defined by the Library is deemed a mode
of using an interface provided by the Library.
A "Combined Work" is a work produced by combining or linking an
Application with the Library. The particular version of the Library
with which the Combined Work was made is also called the "Linked
Version".
The "Minimal Corresponding Source" for a Combined Work means the
Corresponding Source for the Combined Work, excluding any source code
for portions of the Combined Work that, considered in isolation, are
based on the Application, and not on the Linked Version.
The "Corresponding Application Code" for a Combined Work means the
object code and/or source code for the Application, including any data
and utility programs needed for reproducing the Combined Work from the
Application, but excluding the System Libraries of the Combined Work.
1. Exception to Section 3 of the GNU GPL.
You may convey a covered work under sections 3 and 4 of this License
without being bound by section 3 of the GNU GPL.
2. Conveying Modified Versions.
If you modify a copy of the Library, and, in your modifications, a
facility refers to a function or data to be supplied by an Application
that uses the facility (other than as an argument passed when the
facility is invoked), then you may convey a copy of the modified
version:
a) under this License, provided that you make a good faith effort to
ensure that, in the event an Application does not supply the
function or data, the facility still operates, and performs
whatever part of its purpose remains meaningful, or
b) under the GNU GPL, with none of the additional permissions of
this License applicable to that copy.
3. Object Code Incorporating Material from Library Header Files.
The object code form of an Application may incorporate material from
a header file that is part of the Library. You may convey such object
code under terms of your choice, provided that, if the incorporated
material is not limited to numerical parameters, data structure
layouts and accessors, or small macros, inline functions and templates
(ten or fewer lines in length), you do both of the following:
a) Give prominent notice with each copy of the object code that the
Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the object code with a copy of the GNU GPL and this license
document.
4. Combined Works.
You may convey a Combined Work under terms of your choice that,
taken together, effectively do not restrict modification of the
portions of the Library contained in the Combined Work and reverse
engineering for debugging such modifications, if you also do each of
the following:
a) Give prominent notice with each copy of the Combined Work that
the Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the Combined Work with a copy of the GNU GPL and this license
document.
c) For a Combined Work that displays copyright notices during
execution, include the copyright notice for the Library among
these notices, as well as a reference directing the user to the
copies of the GNU GPL and this license document.
d) Do one of the following:
0) Convey the Minimal Corresponding Source under the terms of this
License, and the Corresponding Application Code in a form
suitable for, and under terms that permit, the user to
recombine or relink the Application with a modified version of
the Linked Version to produce a modified Combined Work, in the
manner specified by section 6 of the GNU GPL for conveying
Corresponding Source.
1) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (a) uses at run time
a copy of the Library already present on the user's computer
system, and (b) will operate properly with a modified version
of the Library that is interface-compatible with the Linked
Version.
e) Provide Installation Information, but only if you would otherwise
be required to provide such information under section 6 of the
GNU GPL, and only to the extent that such information is
necessary to install and execute a modified version of the
Combined Work produced by recombining or relinking the
Application with a modified version of the Linked Version. (If
you use option 4d0, the Installation Information must accompany
the Minimal Corresponding Source and Corresponding Application
Code. If you use option 4d1, you must provide the Installation
Information in the manner specified by section 6 of the GNU GPL
for conveying Corresponding Source.)
5. Combined Libraries.
You may place library facilities that are a work based on the
Library side by side in a single library together with other library
facilities that are not Applications and are not covered by this
License, and convey such a combined library under terms of your
choice, if you do both of the following:
a) Accompany the combined library with a copy of the same work based
on the Library, uncombined with any other library facilities,
conveyed under the terms of this License.
b) Give prominent notice with the combined library that part of it
is a work based on the Library, and explaining where to find the
accompanying uncombined form of the same work.
6. Revised Versions of the GNU Lesser General Public License.
The Free Software Foundation may publish revised and/or new versions
of the GNU Lesser General Public License from time to time. Such new
versions will be similar in spirit to the present version, but may
differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the
Library as you received it specifies that a certain numbered version
of the GNU Lesser General Public License "or any later version"
applies to it, you have the option of following the terms and
conditions either of that published version or of any later version
published by the Free Software Foundation. If the Library as you
received it does not specify a version number of the GNU Lesser
General Public License, you may choose any version of the GNU Lesser
General Public License ever published by the Free Software Foundation.
If the Library as you received it specifies that a proxy can decide
whether future versions of the GNU Lesser General Public License shall
apply, that proxy's public statement of acceptance of any version is
permanent authorization for you to choose that version for the
Library.

View File

@@ -0,0 +1,23 @@
<?php
/*************************************************************************************/
/* This file is part of the Thelia package. */
/* */
/* Copyright (c) OpenStudio */
/* email : dev@thelia.net */
/* web : http://www.thelia.net */
/* */
/* For the full copyright and license information, please view the LICENSE.txt */
/* file that was distributed with this source code. */
/*************************************************************************************/
namespace HookNavigation\Model\Config\Base;
/**
* Class HookNavigationConfigValue.
*/
class HookNavigationConfigValue
{
const FOOTER_BODY_FOLDER_ID = 'footer_body_folder_id';
const FOOTER_BOTTOM_FOLDER_ID = 'footer_bottom_folder_id';
}

View File

@@ -0,0 +1,23 @@
<?php
/*************************************************************************************/
/* This file is part of the Thelia package. */
/* */
/* Copyright (c) OpenStudio */
/* email : dev@thelia.net */
/* web : http://www.thelia.net */
/* */
/* For the full copyright and license information, please view the LICENSE.txt */
/* file that was distributed with this source code. */
/*************************************************************************************/
namespace HookNavigation\Model\Config;
use HookNavigation\Model\Config\Base\HookNavigationConfigValue as BaseHookNavigationConfigValue;
/**
* Class HookNavigationConfigValue.
*/
class HookNavigationConfigValue extends BaseHookNavigationConfigValue
{
}

View File

@@ -0,0 +1,11 @@
{
"name": "thelia/hook-navigation-module",
"license": "LGPL-3.0+",
"type": "thelia-module",
"require": {
"thelia/installer": "~1.1"
},
"extra": {
"installer-name": "HookNavigation"
}
}

View File

@@ -0,0 +1,116 @@
{extends file="admin-layout.tpl"}
{block name="no-return-functions"}
{$admin_current_location = 'modules'}
{/block}
{block name="page-title"}{intl d="hooknavigation.bo.default" l='HookNavigation configuration'}{/block}
{block name="check-resource"}admin.module{/block}
{block name="check-access"}view{/block}
{block name="check-module"}HookNavigation{/block}
{block name="main-content"}
<div class="container" id="wrapper">
<ul class="breadcrumb">
<li><a href="{url path='/admin'}">{intl l="Home" d="hooknavigation.bo.default"}</a></li>
<li><a href="{url path='/admin/modules'}">{intl l="Modules" d="hooknavigation.bo.default"}</a></li>
<li>{intl l="HookNavigation configuration" d="hooknavigation.bo.default"}</li>
</ul>
<div class="general-block-decorator">
<div class="title title-without-tabs">
{intl l="Configure hooknavigation" d="hooknavigation.bo.default"}
</div>
<div class="row">
<div class="col-md-12">
{if $success}
<div class="alert alert-success">
{intl l="Configuration correctly saved" d="hooknavigation.bo.default"}
</div>
{/if}
{form name="hooknavigation.configuration"}
<form action="{$current_url}" method="post">
{include "includes/inner-form-toolbar.html" hide_flags = 1 close_url={url path='/admin/modules'}}
<br/>
{form_field form=$form field="success_url"}
<input type="hidden" name="{$name}" value="{url path='/admin/modules'}" />
{/form_field}
{form_hidden_fields form=$form}
{flash type="bodyConfig"}
{assign var='bodyConfig' value=$MESSAGE}
{/flash}
{flash type="bottomConfig"}
{assign var='bottomConfig' value=$MESSAGE}
{/flash}
{form_field form=$form field="footer_body_folder_id"}
<div class="form-group {if $error}has-error{/if}">
<label class="control-label" for="{$label_attr.for}">
{$label}
{if $required}<span class="required">*</span>{/if}
{form_error form=$form field="footer_body_folder_id"}
<br />
<span class="error">{$message}</span>
{/form_error}
</label>
<select id="{$label_attr.for}" class="form-control" name="{$name}" >
<option>--- {intl l="Select a folder" d="hooknavigation.bo.default"} ---</option>
{loop type="folder" name="folder_list_body"}
<option value="{$ID}" {if $bodyConfig == $ID}selected{/if}>
{$TITLE}
</option>
{/loop}
</select>
{if ! empty($label_attr.help)}
<span class="help-block">{$label_attr.help}</span>
{/if}
</div>
{/form_field}
{form_field form=$form field="footer_bottom_folder_id"}
<div class="form-group {if $error}has-error{/if}">
<label class="control-label" for="{$label_attr.for}">
{$label}
{if $required}<span class="required">*</span>{/if}
{form_error form=$form field="footer_bottom_folder_id"}
<br />
<span class="error">{$message}</span>
{/form_error}
</label>
<select id="{$label_attr.for}" class="form-control" name="{$name}" >
<option>--- {intl l="Select a folder" d="hooknavigation.bo.default"} ---</option>
{loop type="folder" name="folder_list_bottom"}
<option value="{$ID}" {if $bottomConfig == $ID}selected{/if}>
{$TITLE}
</option>
{/loop}
</select>
{if ! empty($label_attr.help)}
<span class="help-block">{$label_attr.help}</span>
{/if}
</div>
{/form_field}
{include "includes/inner-form-toolbar.html" hide_flags = 1 close_url={url path='/admin/modules'} page_bottom = 1}
</form>
{/form}
</div>
</div>
</div>
</div>
{/block}
{block name="javascript-initialization"}
{/block}

View File

@@ -0,0 +1,17 @@
{ifloop rel="blog.articles"}
<ul>
{loop type="folder" name="blog.articles" folder=$bodyFolderId limit=4}
<li>
<a href="{$URL}">
<h4 class="block-subtitle">{$TITLE}</h4>
<p>{$CHAPO}</p>
</a>
</li>
{/loop}
</ul>
{/ifloop}
{elseloop rel="blog.articles"}
<ul>
<li>{intl l="No articles currently" d="hooknavigation.fo.default"}</li>
</ul>
{/elseloop}

View File

@@ -0,0 +1,7 @@
<nav class="nav-footer" role="navigation">
<ul class="list-unstyled list-inline">
{loop type="folder" name="blog.articles" folder=$bottomFolderId limit=4}
<li><a href="{$URL}">{$TITLE}</a></li>
{/loop}
</ul>
</nav>

View File

@@ -0,0 +1,56 @@
<nav class="navbar navbar-default nav-main" role="navigation" itemscope itemtype="http://schema.org/SiteNavigationElement">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar-primary">
<span class="sr-only">{intl l="Toggle navigation" d="hooknavigation.fo.default"}</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand visible-xs-block visible-sm-block" href="{navigate to="index"}">{intl l="Categories" d="hooknavigation.fo.default"}</a>
</div>
<div class="collapse navbar-collapse" id="navbar-primary">
<ul class="nav navbar-nav navbar-categories">
<li><a href="{navigate to="index"}" class="home">{intl l="Home" d="hooknavigation.fo.default"}</a></li>
{loop type="category" name="category.navigation" parent="0" need_count_child="yes"}
{if $CHILD_COUNT > 0}
<li class="dropdown">
<a href="{$URL}" class="dropdown-toggle">{$TITLE}</a>
<ul class="dropdown-menu" role="menu">
{loop type="category" name="sub-cat" parent="{$ID}"}
<li><a href="{$URL}">{$TITLE}</a></li>
{/loop}
</ul>
</li>
{else}
<li><a href="{$URL}">{$TITLE}</a></li>
{/if}
{/loop}
</ul>
</div>
</div>
</nav>
{* classic navbar without dropdown
<nav class="navbar navbar-default nav-main" role="navigation" itemscope itemtype="http://schema.org/SiteNavigationElement">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar-primary">
<span class="sr-only">{intl l="Toggle navigation" d="hooknavigation.fo.default"}</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand visible-xs-block visible-sm-block" href="{navigate to="index"}">{intl l="Categories" d="hooknavigation.fo.default"}</a>
</div>
<div class="collapse navbar-collapse" id="navbar-primary">
<ul class="nav navbar-nav navbar-categories">
<li><a href="{navigate to="index"}" class="home">{intl l="Home" d="hooknavigation.fo.default"}</a></li>
{loop type="category" name="category.navigation" parent="0"}
<li><a href="{$URL}">{$TITLE}</a></li>
{/loop}
</ul>
</div>
</div>
</nav>
*}