Skip to content
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

Closes #2091, #1605, #1772 Add an optional thumbnail image field to AZ News, AZ Event #2308

Merged
merged 19 commits into from
May 12, 2023

Conversation

bberndt-uaz
Copy link
Contributor

@bberndt-uaz bberndt-uaz commented Mar 27, 2023

(Description last updated Apr 24, 2023)

Description

Closes #2091, #1605, and #1772 with the following changes:

  1. Added a Thumbnail Image field and a Use Featured Image as Thumbnail field to the AZ News and AZ Event content types.
  2. Added pre-save hooks so that the Thumbnail Image field is automatically set to match the featured image for the node if the checkbox for the Use Featured Image as Thumbnail field is checked.
  3. Added a new Grid View with Images view display for AZ Event, as an alternative to the Grid View.
  4. Added a new Card Alternate view mode and a new Card Alternate display for AZ Event to support the new view.
  5. Updated the Row display for AZ Event to include the thumbnail image displayed with the Square (220X220px) view mode.
  6. Added a new Square Aspect Ratio crop type and updated the Square (220x220) image style to allow manual cropping.
  7. Updated all AZ News displays using the Card Image or Thumbnail (100 x 100) view modes to use the new Thumbnail Image field instead of the Photo field for that image.
  8. Added new content for news and events to the demo module which demonstrates usage of the optional thumbnail field.
  9. Added a new process plugin in az_core to allow migrating multiple images to the Event Photos field.
  10. Removed unused field groups from the Card display for AZ Event, the Medium Media List display for AZ News, and the Minimal Media List display for AZ News.

Related issues

#2091, #1605, #1772

How to test

Link to Probo site

  • Confirm that all news and event content type displays and views appear as expected (especially the updated Row display of events).
  • Confirm that editing images in news and event nodes works as expected.
  • Confirm that applying Card Image and Square Aspect Ratio cropping to thumbnail images works properly.
  • Confirm that the new demo module content is adequate and appropriate.

Previous feedback requested:

  • Is it correct that the Grid View for events should be left as is? If so, is there a better way to provide a new Grid View with Images for events that does not require creating a new view mode for nodes?
    • Answer from 3-29 discussion: Yes, leave the Grid View appearance as is. We can consider using preprocessing to display the two views differently.
  • Should the Grid Sidebar view for events include the thumbnail images as well? Should an alternate sidebar view with images be created instead?
    • Answer from 3-29 discussion: No, leave the Grid Sidebar as is. We can add thumbnails to it later if desired.

Types of changes

Arizona Quickstart (install profile, custom modules, custom theme)

  • Patch release changes
    • Bug fix
    • Accessibility, performance, or security improvement
    • Critical institutional link or brand change
    • Adding experimental module
    • Update experimental module
  • Minor release changes
    • New feature
    • Breaking or visual change to existing behavior
    • Upgrade experimental module to stable
    • Enable existing module by default or database update
    • Non-critical brand change
    • New internal API or API improvement with backwards compatibility
    • Risky or disruptive cleanup to comply with coding standards
    • High-risk or disruptive change (requires upgrade path, risks regression, etc.)
  • Other or unknown
    • Other or unknown

Drupal core

  • Patch release changes
    • Security update
    • Patch level release (non-security bug-fix release)
    • Patch removal that's no longer necessary
  • Minor release changes
    • Major or minor level update
  • Other or unknown
    • Other or unknown

Drupal contrib projects

  • Patch release changes
    • Security update
    • Patch or minor level update
    • Add new module
    • Patch removal that's no longer necessary
  • Minor release changes
    • Major level update
  • Other or unknown
    • Other or unknown

Checklist

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@bberndt-uaz bberndt-uaz marked this pull request as ready for review March 28, 2023 21:03
@bberndt-uaz bberndt-uaz requested a review from a team as a code owner March 28, 2023 21:03
@joeparsons
Copy link
Member

joeparsons commented Mar 29, 2023

Tasks identified during 2023-03-29 PR meeting:

  • Figure out why cache tag invalidation isn't happening as expected (create separate issue)
  • Find solution to allow setting a feature image without setting a thumbnail image
  • Remove Card Alternate view mode if possible

@bberndt-uaz
Copy link
Contributor Author

To follow up on the "Card Alternate" view mode which this PR currently adds: the end goal is to provide a new view which is the same as the Grid View except that it includes the thumbnail image for each event card (see the comparison page on Probo). Which of these options below is preferable? Is there another option I'm missing?

  1. (current behavior of the PR) Add a Card Alternate view mode and display for events. Use the view mode in the new Grid View with Images view display.
    a. Pros: Allows customization of the content type display through the Drupal UI. If desired, events could also be embedded in text areas with the Card Alternate view mode.
    b. Cons: The view mode name is vague (since other Card view modes already include images).
  2. Duplicate the Grid View display for the new Grid View with Images view display. Use a twig template (or hook?) to add the thumbnail image to event cards in the new view display.
    a. Pros: No additional content type display or view mode required.
    b. Cons: The display of event cards with thumbnail images will not be customizable through the Drupal UI.
  3. Duplicate the Grid View display for the new Grid View with Images view display. Change the existing Card display for events to include the thumbnail image. Use one or more hooks to hide the image on event cards except for those in the new Grid View with Images view display.
    a. Pros: No additional content type display, view mode, or twig template required.
    b. Cons: The display of event cards with thumbnail images will not be customizable through the Drupal UI. I believe this approach could potentially have unintended consequences since the existing content type display is being modified.

@bberndt-uaz
Copy link
Contributor Author

Per our AZ Digital discussion last Wednesday, the Card Alternate view mode is an acceptable solution for this issue (option 1 above).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.7.x only enhancement New feature or request
Projects
None yet
4 participants