? ? ? Pending

User tests: Successful: Unsuccessful:

avatar infograf768
infograf768
20 Jan 2020

Pull Request for Issue #27549

Summary of Changes

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.

Testing Instructions

Patch. NPM needed.

Edit Cassiopea template style, Advanced tab.
Set Sticky Header to Yes

Screen Shot 2020-01-20 at 10 48 42

Display frontend and scroll.

Expected result

sticky

Note

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.

avatar infograf768 infograf768 - open - 20 Jan 2020
avatar infograf768 infograf768 - change - 20 Jan 2020
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 20 Jan 2020
Category Language & Strings Front End Templates (site)
avatar infograf768 infograf768 - change - 20 Jan 2020
Labels Added: ? ?
avatar jwaisner
jwaisner - comment - 20 Jan 2020

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).
27579

avatar infograf768
infograf768 - comment - 20 Jan 2020

@jwaisner
Switcher should now be Ok.

avatar infograf768
infograf768 - comment - 20 Jan 2020

@C-Lodder
Moved the new css to _layout.scss

npm needed.

avatar infograf768 infograf768 - change - 20 Jan 2020
The description was changed
avatar infograf768 infograf768 - edited - 20 Jan 2020
37bdd98 20 Jan 2020 avatar infograf768 cs
avatar infograf768
infograf768 - comment - 20 Jan 2020

Folks, if #27566 is tested and merged, this PR will be modified.

avatar jwaisner jwaisner - test_item - 20 Jan 2020 - Tested successfully
avatar jwaisner
jwaisner - comment - 20 Jan 2020

I have tested this item successfully on 37bdd98


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/27579.

avatar jwaisner
jwaisner - comment - 20 Jan 2020

I have tested this item successfully on 37bdd98


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/27579.

avatar infograf768
infograf768 - comment - 21 Jan 2020

@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.

avatar brianteeman
brianteeman - comment - 21 Jan 2020

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.

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

scss

image

css

image

avatar infograf768
infograf768 - comment - 21 Jan 2020

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.

avatar ChristineWk ChristineWk - test_item - 21 Jan 2020 - Tested successfully
avatar ChristineWk
ChristineWk - comment - 21 Jan 2020

I have tested this item successfully on f5c1f72


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/27579.

avatar ChristineWk
ChristineWk - comment - 21 Jan 2020

I have tested this item successfully on f5c1f72


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/27579.

avatar infograf768
infograf768 - comment - 21 Jan 2020

@jwaisner
Please test again.

avatar Quy
Quy - comment - 21 Jan 2020

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),

avatar ciar4n
ciar4n - comment - 21 Jan 2020

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.

avatar brianteeman
brianteeman - comment - 21 Jan 2020

yes and the search postion

avatar jwaisner jwaisner - test_item - 22 Jan 2020 - Tested successfully
avatar jwaisner
jwaisner - comment - 22 Jan 2020

I have tested this item successfully on 9b669f6


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/27579.

avatar jwaisner
jwaisner - comment - 22 Jan 2020

I have tested this item successfully on 9b669f6


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/27579.

avatar infograf768
infograf768 - comment - 22 Jan 2020

Do you want to add this parameter to joomla.sql?

Not sure it is absolutely necessary as the absence of the parameter = No

avatar infograf768
infograf768 - comment - 22 Jan 2020

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.

avatar infograf768 infograf768 - change - 22 Jan 2020
Status Pending Ready to Commit
avatar infograf768
infograf768 - comment - 22 Jan 2020

RTC.

It is now the decision of maintainers to get this feature in or not.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/27579.

avatar infograf768 infograf768 - change - 22 Jan 2020
Labels Added: ?
avatar ciar4n
ciar4n - comment - 22 Jan 2020

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.

avatar infograf768
infograf768 - comment - 22 Jan 2020

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?

avatar ciar4n
ciar4n - comment - 22 Jan 2020

Try this applied to the .container-header class..

@include media-breakpoint-up(sm) {
  position: relative !important;
}
avatar infograf768
infograf768 - comment - 23 Jan 2020

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?

avatar wilsonge
wilsonge - comment - 25 Jan 2020

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

avatar infograf768
infograf768 - comment - 26 Jan 2020

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

avatar infograf768
infograf768 - comment - 26 Jan 2020

Now unstuck in mobile view.
@ChristineWk @jwaisner @ciar4n
Please test again.

Needs npm

avatar rdeutz rdeutz - change - 3 Feb 2020
Status Ready to Commit Pending
avatar rdeutz
rdeutz - comment - 3 Feb 2020

Removed RTC because a new round of testing is requested from the author of the PR


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/27579.

avatar brianteeman brianteeman - test_item - 3 Feb 2020 - Tested successfully
avatar brianteeman
brianteeman - comment - 3 Feb 2020

I have tested this item successfully on d6ae643

It works as described but I really don't like just adding more and more parameters


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/27579.

avatar jwaisner jwaisner - test_item - 3 Feb 2020 - Tested successfully
avatar jwaisner
jwaisner - comment - 3 Feb 2020

I have tested this item successfully on d6ae643


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/27579.

avatar Quy Quy - change - 3 Feb 2020
Status Pending Ready to Commit
avatar Quy
Quy - comment - 3 Feb 2020

RTC


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/27579.

avatar rdeutz rdeutz - change - 5 Feb 2020
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
avatar rdeutz rdeutz - close - 5 Feb 2020
avatar rdeutz rdeutz - merge - 5 Feb 2020

Add a Comment

Login with GitHub to post a comment