Open UTCbridget opened 3 weeks ago
@UTCbridget I have a couple of questions.
That's a good point. The problem I see is that some section editors use the cards with words within the image and then use the card as a link, resulting in a blank white space below the image like this:
So, let's try this instead of what I said above to solve both problems:
On line 48, insert this code
{% elseif (card_title is empty) and (card_text is empty) %}
{% set card_classes = [
'utc-card-2',
card_type ? 'utc-card-2--' ~ card_type,
card_width ? 'utc-card-2--w-' ~ card_width,
card_link ? 'utc-card-2--card-link',
card_img_fill ? card_img_fill
] | sort | join(' ') | trim %}
That will change this
to this, which still looks weird if one card has a headline
but not if all the cards are consistently sans headline and text.
We can hope that if they see something weird they'll change it or we can force all three cards to have the same treatment regardless of whether it's empty or not.
This was one culprit I recently came by (though this page is no longer existent). https://utcclouddev2.prod.acquia-sites.com/enrollment-management-and-student-affairs/pre-health-professions-advising/events/2024-pre-health-expo-events-and-information
But I've seen several like this sporadically done.
regarding the block--utc-card-base.html.twig... It should be right above the block--utc-card.html.twig
We need to create a condition that only shows the body text div "utc-card-2__body" if body text is present. The reason is that there is padding associated with that div that creates a blank white space under images if there is no text.
The variables (for each individual card) is found in this file: block--utc-card.html.twig The condition is currently on line 89 (closing on 92), but needs to be moved to line 80 (closing on 103): block--utc-card-base.html.twig