-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[4.0] Upgrade column blog layouts to according CSS classes #31570
[4.0] Upgrade column blog layouts to according CSS classes #31570
Conversation
@richard67 please have a look here. This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/31570. |
I am assuming this is referring to article 4 in the screenshot for cassiopeia vertical ? I agree that the scss implies the intention was to prevent the column break. If you are saying it doesn't work then wont simply fixing it prevent the need for any extra classes |
Yes, exactly.
I guess so. Maybe @ciar4n or somebody who is more involved with the Cassiopeia template can tell whether the current behaviour is intended or not? I don't want to break anything just because I assume it's a bug. |
Are you using firefox? |
Ohh. Yes I am. And in Chromium, the breaking is indeed avoided. Good point! So this seems to be some weird Firefox thing that it doesn't respect |
It is a known bug which is why I asked ;) See https://www.smashingmagazine.com/2019/02/css-fragmentation/ |
Hmm, if I'm not missing anything, that article says that Firefox has issues with |
For the "categories" view, I now chose the simplest option, that is, adding the "blog class leading" and "blog class" field to the "Blog Layout" tab of this view. |
Looks really good. It resolves the migration problem in an elegant way without needs for extra params in J4. About the categories view: |
Checking something on a 3.10-0-alpha4-dev: a) Articles Options Blog/Featured Layouts > Multi Column Order: down or across. b) Menu Item Typ: Category List > Choose a Category > there are no columns. c) Here I'm not sure: |
No, they are used indeed. I'm going to update the test instructions with this.
This includes the columns parameters. So if you select to display two columns there, this does not apply directly to the "List all categories" view, but to category views accessible from there. @ChristineWk This PR treats cases a) and c) (plus d) the menu item type "List all categories", as explained above).
Correct, the category list doesn't include columns and thus, needs no changes here. |
Where are you getting masonry from? in bs4 its card-columns. https://getbootstrap.com/docs/4.5/components/card/#card-columns |
At the moment it is bootstrap4. I would prefer a pure css solution, but this not necessary in scope of this pr |
Masonry classes were introduced in #18319. But yes, card-columns might be an alternative. |
Thank you for testing!
That's a known issue, see comment by @ChristineWk. Not sure if it's fixed by #31561, but we can ignore it for this PR. In order to update based on this PR here, you need to use a custom update package. I added some details to the testing instructions. If it's not clear what to do, feel free to ask! :-)
This PR does not re-introduce the parameters, because in #18319, the choice was made to remove these parameters and use CSS classes instead. This PR adds a step to the update to 4.0 (which is why you need to use the update package of this PR instead of applying the PR after the update). There, the parameters from J3 are converted to the according CSS classes for J4.
No, not for this PR. |
Sorry The parameter Blog Class works. |
I have tested this item ✅ successfully on 905d509 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/31570. |
I have tested this item ✅ successfully on 905d509 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/31570. |
@Harmageddon Could you please wait with merging, as I'm trying to start the update from J 3.10.0.alpha4-dev to J 4.0.0 (with the update package) Thks. I hope it will work :-) This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/31570. |
a) Update was successful: b) Your site has been updated. Your Joomla version is now 4.0.0-beta6-dev+pr.31570 c) but: It's broken. Then I made some checks etc: There are tables not up to date! > Then Repair button > Update Structure > OK now. Then I checked via "System" > Templates Maintenance: Global Check in of: Templates Style: Changed Cassiopeia to default. System Dashboard = OK This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/31570. |
About the Open Points: My suggestion
I think that users would understand best the masonry-x. Otherwise we must explain our own class. We can use this now as is or override the whole in our scss / layouts. Would be nice to have mor meanings about that. |
As this PR here is still in draft status, and the alternative PR #30910 has been closed, should the issue #27478 be re-opened and the newer duplicate issue #31801 by the same author be closed? Or vice versa? @Harmageddon Any plans about when you will mark the PR as ready for review? |
@richard67 |
I planned to allow for a discussion here regarding the open points (global parameter for Blog Class and the things @chmst pointed out). But if everyone implicitly agrees in silence, I'm going to add the global parameter, resolve the review above, and mark it as ready for review in the next few days. ;-) |
@Harmageddon yes, please do so. I will be happy to test it and think that it is the best solution we can get. |
I added the global parameters for the blog class fields, along with a table in the testing instructions above that indicates which setting should lead to which result. |
Thats works. Thank you!
Hmm. Tested something: Menus Edit Item: Blog Layout it shows: a) if you want to delete the: masonry-2. It‘s (was) not possible, it will be changed to: "Use Global (masonry-2)" and becomes inactive. b) To change that menu to 1 column, you have to enter (overwrite) with e.g: column-1. Thats works. All other menus remains unchanged (= still showing e.g. masonry-2 Layout) = OK. |
@Harmageddon Could you remove the sentence about draft status at the beginning of the testing instructions? Thanks in advance. |
@richard67 Oh, sorry. Done! Thank you for the reminder. :-) |
I have tested this item ✅ successfully on ef54688 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/31570. |
Thanks @drmenzelit for testing. In principle, the test was also successful for me, but I waited for a comment, because of the topic of column-1, as written above. Ev. to enter manually: column-1 (if desired) was just a suggestion & shouldn't be a problem. |
@ChristineWk sorry, I missed your comment... |
a) That is the same behaviour as in columns parameters in J3, if you don't set a specific number of columns in the menu item, the global configuration will be taken |
Thanks Viviana for your clarification/help
That's what I meant. |
I have tested this item ✅ successfully on ef54688 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/31570. |
RTC This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/31570. |
@ChristineWk @drmenzelit Thank you for testing! :-) |
This makes sense to me. Nice job - thanks! |
Pull Request for Issue #27478. This is an alternative approach to #30910.
Summary of Changes
Instead of re-adding the parameters that were removed with #18319, this approach searches for the "column" and "ordering" parameters from J3 and converts the values into the according CSS classes, i.e.
columns-X
in the case of horizontal ordering, ormasonry-X
in the case of vertical ordering.Testing Instructions
As this PR modifies the update mechanism, you need to test it by upgrading a J3 site to J4. Note that you might not be able to update afterwards to higher J4-beta versions on the same site (don't know how this behaves with PR update packages). So I'd recommend to set up a clean, new installation (or a copy from an existing one) only for this PR.
How to test the "List All Categories" menu item type
Actual result BEFORE applying this Pull Request
("before applying this PR" = using an unpatched update package, such as the normal beta6 or nightly build)
All blog views are rendered in only one column, all with the same order. The above-mentioned parameters are gone without a trace.
Expected result AFTER applying this Pull Request
The number of columns should stay the same compared to before the upgrade. Depending on whether the according menu item used horizontal or vertical ordering, the articles should now be arranged in a similar manner.
More precisely (with "local" = set in the menu item, "global" = in the configuration of com_content):
Obviously, this table is not exhaustive because listing all possible combinations would take some time and space. So please feel free to come up with your own combinations!
Documentation Changes Required
Not sure where to document this. We definitely need to document what classes are available for layouts in the Cassiopeia template.
Open Points
joomla-cms/templates/cassiopeia/scss/blocks/_modifiers.scss
Lines 214 to 224 in 8053386
I could add another modifier CSS class that could be used to avoid breaking. In that case, the next question would be whether this class should be included in the conversion from J3 to J4 that is done with this PR. Or we could change this for the masonry layout in general, if breaking inside articles is not intended at all. Comments?
Screenshots