User tests: Successful: Unsuccessful:
Pull Request for Issue #27549
Adding css and parameter to make the Header sticky if desired.
Default to No.
FI: I had to add the css in index.php as adding it in grid scss did not work.
Patch. NPM needed.
Edit Cassiopea template style, Advanced tab.
Set Sticky Header
to Yes
Display frontend and scroll.
Works here on Chrome, Firefox, Safari, Opera. Did not test other browsers.
I have no pre-conceived idea about adding this parameter or not, but we now have the choice to add this to Cassiopea if maintainers desire.
Status | New | ⇒ | Pending |
Category | ⇒ | Language & Strings Front End Templates (site) |
Labels |
Added:
?
?
|
I have tested this item
I have tested this item
@C-Lodder
tested here after patching with #27566
I tested applying sticky-header
to <header
after modiying the css by taking off margin: 0 0 20px 0 !important;
as margins are now OK in .container-header header
In this case, it does not work with Chrome or Opera.
WE definitely need to apply the new class to div class="grid-child container-header full-width <?php echo $stickyHeader; ?>">
Will modify this PR as soon as #27566 is merged.
You do not need to have the webkit line in the scss. The build script deals with that automatically as shown in the screenshots below.
OK. It would work indeed, but no use. I will delete that scss. See below.
But why are we even adding any css at all. This is a bootstrap template and bootstrap has its own utility class for this already called position-sticky
I had tested that. position-sticky
is missing an essential part: top: 0;
Without it, it does not work.
But after also adding sticky-top
in order to have the following code
$stickyHeader = $this->params->get('stickyHeader') ? 'position-sticky sticky-top' : '';
it works fine in all browsers tested.
Modifying this now as using layout scss is useless.
I have tested this item
I have tested this item
Do you want to add this parameter to joomla.sql?
(0, 'cassiopeia', 'template', 'cassiopeia', '', 0, 1, 1, 0, '', '{"logoFile":"","fluidContainer":"0","sidebarLeftWidth":"3","sidebarRightWidth":"3"}', 0, NULL, 0, 0),
I haven't tested this but would this not also stick the banner position? Maybe an issue on small devices if anything large in there.
yes and the search postion
I have tested this item
I have tested this item
Do you want to add this parameter to joomla.sql?
Not sure it is absolutely necessary as the absence of the parameter = No
I haven't tested this but would this not also stick the banner position?
Yep, it does. That's why we have a parameter to choose sticky or not, default being No which I would recommend in case of large banner usage..
Using a banner image wider than the mobile window size shrinks the image width (not proportionnaly) and is not recommended anyway.
Basically, as for most aspects, it depends on the site owner decisions.
yes and the search postion
Nope. Search is in the toggler as well as the menu position.
Status | Pending | ⇒ | Ready to Commit |
RTC.
It is now the decision of maintainers to get this feature in or not.
Labels |
Added:
?
|
That's why we have a parameter to choose sticky or not, default being No which I would recommend in case of large banner usage..
A fair point but personally I would just stick the navigation/logo. Also may be worth wrapping it in a media query so it only applies to desktops.
A fair point but personally I would just stick the navigation/logo.
The only way I found was to separate totally the banner from the container-header
<div>
Also may be worth wrapping it in a media query so it only applies to desktops.
We indeed could do that.
We would have to override bootstrap. In which scss would you do that?
In any case, if the banner is huge, we would have the same issue in mobile view. Is it worth?
Try this applied to the .container-header
class..
@include media-breakpoint-up(sm) {
position: relative !important;
}
Try this applied to the .container-header class..
Would rather be down
instead of up
, i.e.
@include media-breakpoint-down(sm) {
position: relative !important;
}
and indeed, for smaller screens, the header would not stick.
@wilsonge @HLeithner
I still think personally that anyone wanting the header to be sticky is not going to add an enormous banner and that keeping the header sticky is also quite useful in mobile mode.
What do you think?
Personally I find sticky headers on mobiles annoying as it reduces the screen size available for the text. So I'd kinda be ok with it tablet and up
Personally I find sticky headers on mobiles annoying as it reduces the screen size available for the text. So I'd kinda be ok with it tablet and up
?♂ but it's just a personal opinion - nothing more
OK, will do in order to get rid of that and concentrate on other matters
Now unstuck in mobile view.
@ChristineWk @jwaisner @ciar4n
Please test again.
Needs npm
Status | Ready to Commit | ⇒ | Pending |
Removed RTC because a new round of testing is requested from the author of the PR
I have tested this item
It works as described but I really don't like just adding more and more parameters
I have tested this item
Status | Pending | ⇒ | Ready to Commit |
RTC
Status | Ready to Commit | ⇒ | Fixed in Code Base |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2020-02-05 08:34:46 |
Closed_By | ⇒ | rdeutz |
Tested on the frontend using both Firefox and Chrome. Sticky function works even in the frontend editor. Default state is "No" as expected.
The only issue is that the switcher for the "Sticky" setting isnt correct for the "no" state. It should be disabled (grey) not enabled (green).