- Issue created by @ckng
- Status changed to Needs review
7 months ago 4:21pm 30 April 2024 - 🇲🇾Malaysia ckng
- Removed classes from page-content.twig, moved to page.twig as properties.
- Fixed 'container' property checking. Was not working for `false` and `''` cases, although specified in the as part of the `enum`. - Merge request !96Issue #3444477 by ckng: improved page-content, removed hardcoded classes; fixed container checking → (Open) created by ckng
Thanks a lot ckng for the MR, all is valid but I wonder why did we change this part:
{% set page_header_container_classes = [ page_header_container_type is null ? 'container' : '', page_header_container_type ? 'container' ~ (page_header_container_type ? '-' ~ page_header_container_type : '') : '', ]|merge(page_header_container_utility_classes ?: []) %}
into:
{% set header_container_class = '' %} {% if page_header_container_type is null %} {% set header_container_class = 'container' %} {% elseif page_header_container_type is not empty %} {% set header_container_class = 'container-' ~ page_header_container_type %} {% endif %} {% set page_header_container_classes = [ header_container_class ]|merge(page_header_container_utility_classes ?: []) %}
also the same for
page_content_container_classes
and if we are to pass
page_content_container_type: false
, isn't that better to set it to false at the source? also I rather keep the container rather than not having it. setting it to false gets rid of it.I got rid of the
py-5
class as you suggested from thepage-content
and passed it from thepage.twig
, let me know if this suffice or you think we need more adjustments.
marking this as fixed, feel free to re-open, thanks- Status changed to Fixed
6 months ago 2:58pm 4 May 2024 - Status changed to Needs review
6 months ago 12:21pm 7 May 2024 - 🇲🇾Malaysia ckng
doxigo, the codes changes for `page_header_container_classes` and `page_content_container_classes` are due to setting `page_header_container_type: false` or ``page_header_container_type: ''` were not working.
In the page-content.component.yml:
page_header_container_type: type: ['string', 'boolean'] title: Container description: container type default: '' enum: - false - '' - sm - md - lg - xl - xxl - fluid
Since we're supporting `false`, `''`, we're unable to use the `page_header_container_type|default` nor `page_header_container_type is empty` checks, as `null`, `false`, `''` are different. Hence the verbose check on `null` first then `is empty` to cover `false` and `''`. The patch fixes all 3 cases.
Thanks ckng, Your adjustments make sense in handling cases where
page_header_container_type
is set tofalse
or anempty
string. It's important to have those checks in place to maintain consistency and avoid any unexpected behavior. Overall, I'm satisfied with the changes you've made, and I agree with merging the MR.- Status changed to Fixed
6 months ago 9:11am 11 May 2024 Automatically closed - issue fixed for 2 weeks with no activity.