Closed (fixed)
Project:
Drupal core
Version:
8.6.x-dev
Component:
Umami demo
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
4 Jul 2018 at 11:30 UTC
Updated:
12 Aug 2018 at 13:54 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
kjay commentedConfirming that I am well under way with a patch for this and will post back for review soon.
Comment #3
kjay commentedBased on the functional and design changes suggested in the parent issue #2980029: Improve Umami demo's support for managing field display settings, here's a patch that covers the config and theme changes that apply specifically to the Article and Recipe content types.
Below is a list of the things changed by this patch. Note that the only deviation I have intentionally made from the designs is that the recipe page looks better with ingredients columns extending across the full body area width, as do the headings for ingredients and recipe instructions.
With this patch it should now be possible to use the Manage Display settings effectively for Article and Recipe content types and for the output of the corresponding full page view mode to make sense. That's not to say that our theme covers the theming for other field types that a user may choose to add, we remain limited to our focus on the fields required for the Umami content model and any fields that happen to work fine when added.
Changes made:
Recipe content type:
Article content type:
Comment #4
john cook commentedI've looked through the full content for articles and recipes. It looks nice and lends itself to show off other features in the future (eg field layout).
I have found some differences between the mock-ups and the rendered pages.
Recipie
In the mock-up, the ingredients and method sections appear to have a max width (796px?), where on the page they are full width.
The ingredients section also has the checked background – same as the image.
Articles
The blockquote is styled slightly differently – left-aligned and with a max width in the mock-up; centered and full-width (with padding) on the page.
The inline image (with caption) also has small differences. On the mock-up the image is full width with the caption in a lighter color. The page the images are not full width and, with a caption, gain extra spacing. The caption is the default text color.
Setting to needs work so that these differences can be checked by the designer.
Comment #5
kjay commentedTo help with review. Here's screenshots of each of the content types after the patch in #3 is applied.
Article screenshot
Recipe screenshot
@John Cook, thanks for reviewing:
Ingredients list:
You can see from these screenshots that I had intentionally deviated from my design for these changes on the Recipe content type to not have the Ingredients list width limited. I'm a little torn on which looks better and it's probably splitting hairs. I did think that given the ingredients list gets reasonably long on some recipes, more space for content on larger screens is of some benefit.
To achieve the designed version, we will need a field-specific twig file for that field in order to add an additional div wrapper for the background effect. I'll experiment with that and update here shortly. Feedback on whether sticking with the ingredients layout as per this patch very welcome!
Blockquote and Inline Images
I need to check but these two elements should probably be spun off as their own issues. The designs have not had the body text updated since version 1 as I've been focusing just on layout for this issue. For example, the originally proposed light grey text for image captions won't meet the accessibility goals we have.
Comment #6
gábor hojtsyThis should also help with content moderation support, as there is currently no way to display the content moderation bar on the page for recipes for example.
Comment #8
kjay commentedSetting back to Needs Review as I think we probably should go with the version in this patch that sets the list of ingredients to use the container width for its content. I'll try and get to updating the designs to avoid confusion.
Comment #9
mohit_aghera commented@kjay
I applied this patch on 8.7.x as well and applied properly.
Implementation approach and related things looks good.
I noticed one styling issue on recipe landing page. I think it is caused due to recent styling change.
I have attached in this screenshot.
Comment #10
gábor hojtsy@mohit_aghera: that is actually by design. See
Comment #11
markconroy commented@kjay
The 'Manage Display' tab for full view mode does not work for articles, because `{{ content.field_tags }}` is hardcoded still. That needs to be removed from node--article--full.html.twig and also remove the `|without(field_tags)` filter from the main printing of `{{ content }}`
The 'Manage Display' tab for full view mode for recipes works a treat. Well done.
For the CSS, I think we should run it through the official Drupal comb - https://www.drupal.org/docs/develop/standards/css/csscomb-settings-for-d... - just to make sure we have everything in the right order.
If we are going to add a `.by-author` class to the node--article--full and the node--recipe--full templates, we should probably also include a node--full template, so if any new content types are created by users and they leave the author info there, they can benefit from this. (or maybe leave it and they'll get default settings).
We should not need the max-width property here, as we already have it on the img element in base.css
^ I quite like that :-)
In `ingredients.css` we have some items set as `rem` and some as `em`. We should probably standardize these. Probably set them all to rem. We might need to do that over more files than just your changes.
Also, if we are not using this, let's remove it:
Besides that, the patch looks really good.
I haven't looked at the config*yml files, as they are just what Drupal pops out.
Comment #12
gábor hojtsyI looked at the config yamls before and they looked just fine.
Comment #13
kjay commentedThanks for the reviews. Assigning back to myself to take a look through @markconroy's suggestions
Comment #14
kjay commentedNew patch and interdiff attached addressing the issues noted in #11.
Mix of em's and rem's in ingredients.css has been adjusted and the mix should now be correct based on attributes relating to the font size.
Please note that I found an additional issue with the node.html.twig where 'display_submitted' is included twice, and it was adopting 'Classy' theme's approach to the html of wrapping with the element immediately after the element. I've therefore removed the duplication in node.html.twig and for consistency adopted the same HTML format in node--recipe--full.html.twig and node--article--full.html.
The CSS included in this patch have been run through CSSComb as per @markconroy's suggestion.
Comment #15
kjay commentedOops. Needs Review. Unassigning myself.
Comment #17
markconroy commentedCan we make sure @smaz gets a credit on this please?
Comment #18
kjay commentedNew patch now with the latest 8.6.x changes merged in which should fix test failures.
Comment #19
kjay commentedSetting to needs review
Comment #20
markconroy commentedI'm movin' this to
R2D2RTBCComment #22
gábor hojtsyComment #23
gábor hojtsyAttempted to commit this because IMHO it looks great. However.
I did not exactly understand why the PNG needed to change, especially that it introduces a whitespace error :)
Comment #24
kjay commentedNew patch addressing issues raised by @Gábor Hojtsy
Regarding #23 1) This is a new PNG for the background pattern introduced for the image on Recipe content type. I believe the white spaces are unavoidable when they crop up in images?
Cheers!
Comment #25
borisson_The changes look good. The whitespace in images is unavoidable, it's popped up in several different patches that added content images.
Comment #28
gábor hojtsyThanks for resolving the little issues I found.
Committed 9949db9 and pushed to 8.7.x and 8.6.x. Thanks!