-
AuthorPosts
-
hdsports Friend
hdsports
- Join date:
- October 2014
- Posts:
- 27
- Downloads:
- 2
- Uploads:
- 4
- Thanks:
- 2
- Thanked:
- 2 times in 2 posts
February 1, 2018 at 9:11 pm #1089679Hey,
first i would say thank you for your great module and the great work. I use the purity template since years and i like it.
but one point i cant realize:
my megamenu is sticky.
and i want a module position over the megamenu that is not sticky
for example like on these sites:
https://nur-positive-nachrichten.de/
https://www.focus.de/
and so on…i have searched in the forum but i found no thread with an solution… what i have found is an way to create a module position over the megamenu.
open header.php
search for
[code]
<?php if ($this->getParam('addon_offcanvas_enable')) : ?> <?php $this->loadBlock ('off-canvas') ?> <?php endif ?> <!-- //OFF-CANVAS -->[/code]
Insert after these code
[code]
<div class="container"><?php if ($this->countModules('top-1')) : ?> <div class="wrap <?php $this->_c('top-1') ?>"> <jdoc:include type="modules" name="<?php $this->_p('top-1') ?>" style="raw" /> </div> <?php endif ?> <!-- HDSports End - für Modul über Menu -->[/code]
When i now create a modul with top-1 than this module will displayed over the megamenu. But the problem: This modul is also sticky and i dont find a way that this module is not sticky…
i think, there should be a way to realize that?
Best regads, tom…
Saguaros ModeratorSaguaros
- Join date:
- September 2014
- Posts:
- 31405
- Downloads:
- 237
- Uploads:
- 471
- Thanks:
- 845
- Thanked:
- 5346 times in 4964 posts
February 2, 2018 at 8:33 am #1089765Hi,
Because the header is set to be fixed position so when you add block into header, of course, it will be sticky.
You can try with this tweak:
1) Create a new block called topbar: root/templates/purity_iii/tpls/blocks/topbar.php this will load new position you created (check out this docs for how to create new block/position: http://www.t3-framework.org/documentation/bs3-layout-system#add-block )
2) Load this block above the header block in the layout. For example, on homepage of our demo site, it’s using feature-intro-2 layout so I open the file: root/templates/purity_iii/tpls/features-intro-2.phpand add this line of code:
<?php $this->loadBlock('topbar') ?>
3) Now open the header block: root/templates/purity_iii/tpls/blocks/header.php
look for this line:
<header id="t3-mainnav" class="wrap navbar navbar-default navbar-fixed-top t3-mainnav">
change it to:
<header id="t3-mainnav" class="wrap navbar navbar-default t3-mainnav">
4) Open the script.js file of Purity III template: root/templates/purity_iii/js/script.js
Add this script to the end of file:
(function($) { // Add affix $(window).load(function(){ var nav_pills = $('#t3-header'); if (nav_pills.length) { setTimeout(function(){ nav_pills.affix({ offset: { top: $('.t3-topbar').height() } }); }, 1000); $(window).resize(function(){ nav_pills.data('bs.affix').options.offset.top = $('.t3-topbar').height(); }); } }); })(jQuery);
5) Go to this custom CSS file: root/templates/purity_iii/css/custom.css (create this file if it doesn’t exist), add this rule:
.t3-mainnav.affix { top: 0; width: 100%; }
Of course, you will need to customize style for topbar block and header if you want then.
Regards
hdsports Friendhdsports
- Join date:
- October 2014
- Posts:
- 27
- Downloads:
- 2
- Uploads:
- 4
- Thanks:
- 2
- Thanked:
- 2 times in 2 posts
February 2, 2018 at 9:41 am #1089804Hello Saguaros thanks for your answer
but it doesnt work when i make the changes in root/templates/purity_iii/tpls/blocks/header.php than also the megamenu is not sticky…
thats the problem. i found no way that only the megamenu is sticky, but not the topbar over the megamenu
- This reply was modified 6 years, 10 months ago by hdsports.
-
AuthorPosts
This topic contains 3 replies, has 2 voices, and was last updated by Saguaros 6 years, 10 months ago.
We moved to new unified forum. Please post all new support queries in our New Forum