Skip to content

Commit

Permalink
Added uk-active class on active toplevel item
Browse files Browse the repository at this point in the history
  • Loading branch information
renekreijveld committed Jul 30, 2021
1 parent 05b7255 commit d520f3a
Show file tree
Hide file tree
Showing 9 changed files with 25 additions and 11 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ Don't forget to turn the option off again!

### Version history

2021-07-30 Added uk-active class on active toplevel item, version bumped to 1.0.4.

2021-07-17 Added update server, version bumped to 1.0.3.

2021-07-15 Warning fix, version bumped to 1.0.2
Expand All @@ -50,4 +52,3 @@ Added coded improvements by Dmitrii Cymbal and added the option to set a dropdow
Also the Modules Anywhere plugin is no longer needed.

2021-07-14 Initial version

2 changes: 1 addition & 1 deletion source/helper.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/**
* @package YOOtheme MegaMenu
* @version 1.0.3
* @version 1.0.4
* @copyright Copyright (C) 2021 Destiny B.V., All rights reserved.
* @license GNU General Public License version 3 or later; see LICENSE.txt
* @author url: https://www.destiny.nl
Expand Down
2 changes: 1 addition & 1 deletion source/language/en-GB/en-GB.mod_yootheme_megamenu.ini
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
; package YOOtheme MegaMenu
; English language file
; version 1.0.3
; version 1.0.4
; copyright (C) 2021 Destiny B.V., All rights reserved.
; license GNU General Public License version 3 or later; see LICENSE.txt
; author url: https://www.destiny.nl
Expand Down
2 changes: 1 addition & 1 deletion source/language/nl-NL/nl-NL.mod_yootheme_megamenu.ini
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
; package YOOtheme MegaMenu
; Dutch language file
; version 1.0.3
; version 1.0.4
; copyright (C) 2021 Destiny B.V., All rights reserved.
; license GNU General Public License version 3 or later; see LICENSE.txt
; author url: https://www.destiny.nl
Expand Down
2 changes: 1 addition & 1 deletion source/mod_yootheme_megamenu.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/**
* @package YOOtheme MegaMenu
* @version 1.0.3
* @version 1.0.4
* @copyright Copyright (C) 2021 Destiny B.V., All rights reserved.
* @license GNU General Public License version 3 or later; see LICENSE.txt
* @author url: https://www.destiny.nl
Expand Down
4 changes: 2 additions & 2 deletions source/mod_yootheme_megamenu.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
<license>GNU General Public License version 3 or later</license>
<authorEmail>email@renekreijveld.nl</authorEmail>
<authorUrl>https://www.destiny.nl</authorUrl>
<version>1.0.3</version>
<description>Mega Menu module for YOOtheme Pro, version 1.0.3.</description>
<version>1.0.4</version>
<description>Mega Menu module for YOOtheme Pro, version 1.0.4.</description>
<updateservers>
<server type="extension" priority="1" name="YOOtheme Mega Menu Module">https://raw.githubusercontent.com/renekreijveld/YOOthemeMegaMenu/main/updates/mod_yootheme_megamenu.xml</server>
</updateservers>
Expand Down
Binary file removed source/mod_yootheme_megamenu_1.0.3.zip
Binary file not shown.
17 changes: 15 additions & 2 deletions source/tmpl/default.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/**
* @package YOOtheme MegaMenu
* @version 1.0.3
* @version 1.0.4
* @copyright Copyright (C) 2021 Destiny B.V., All rights reserved.
* @license GNU General Public License version 3 or later; see LICENSE.txt
* @author url: https://www.destiny.nl
Expand All @@ -16,6 +16,11 @@

defined('_JEXEC') or die;
use Joomla\CMS\Helper\ModuleHelper;
use Joomla\CMS\Factory;

$app = Factory::getApplication();
// Get current Itemid to add uk-active class to active toplevel item
$itemId = $app->input->getCmd('Itemid', '');

?>

Expand All @@ -28,7 +33,15 @@

<ul class="uk-navbar-nav <?php echo $moduleclass; ?>">
<?php foreach ($toplevelitems as $item) : ?>
<li>
<?php
// Determine if active class uk-active has to be set
$liClass = '';
if ($item->linktype === 'internal' && $itemId === $item->internallink)
{
$liClass = ' class="uk-active"';
}
?>
<li<?php echo $liClass; ?>>
<a href="<?php echo $item->link; ?>" <?php echo $item->target; ?>><?php echo $item->title; ?><?php echo $item->showdd; ?></a>
<?php if ($item->ddkind === 'mega' || $item->ddkind === 'single') : ?>
<div class="<?php echo ($item->ddkind === 'mega' ? 'uk-width-large' : '');?> <?php echo $item->ddkind; ?>" uk-dropdown="<?php echo $item->offset . $item->position . $item->animation; ?>">
Expand Down
4 changes: 2 additions & 2 deletions updates/mod_yootheme_megamenu.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
<element>mod_yootheme_megamenu</element>
<type>module</type>
<client>site</client>
<version>1.0.3</version>
<version>1.0.4</version>
<infourl title="Joomla!">https://github.com/renekreijveld/YOOthemeMegaMenu</infourl>
<downloads>
<downloadurl type="upgrade" format="zip">https://github.com/renekreijveld/YOOthemeMegaMenu/releases/download/1.0.3/mod_yootheme_megamenu_1.0.3.zip</downloadurl>
<downloadurl type="upgrade" format="zip">https://github.com/renekreijveld/YOOthemeMegaMenu/releases/download/1.0.4/mod_yootheme_megamenu_1.0.4.zip</downloadurl>
</downloads>
<maintainer>René Kreijveld</maintainer>
<maintainerurl>https://www.destiny.nl</maintainerurl>
Expand Down

0 comments on commit d520f3a

Please sign in to comment.