unlcms / project-herbie

Drupal 10 implementation at the University of Nebraska–Lincoln
https://cms.unl.edu
GNU General Public License v2.0
5 stars 6 forks source link

Create News item content type #92

Closed ericras closed 4 years ago

ericras commented 4 years ago

Starting off with a simple News content type. Things like Tags, share buttons, etc can be added later.

Title Image Body

The full page should have a view of additional stories at the bottom. And that same view of recent stories should be available in Layout Builder for use on the home page.

Stressed out  Americans making themselves sick over politics   CMS   University of Nebraska–Lincoln

ericras commented 4 years ago

Needed some additional help for adding dcf-inverse to things within the view. Also, took the opportunity to fix the dcf-inverse label/title problem in the general field case, like with the Body field.

Screen Shot 2019-09-27 at 3 31 10 PM
macburgee1 commented 4 years ago

Lead Image

Image Styles Should Enforce a Ratio

Currently, the Lead Image field uses the 'Wide' responsive image style. This responsive image style uses the 'Inline' family of image styles, which do not enforce a ratio. I think we should enforce a ratio (e.g. 16x9) to consistently present news lead images - both on the item's page and on related views, such as 'Recent News'.

File Upload Preview

Set the file upload preview to use an image style with the ratio selected for use with Lead Images.

Lead Image Required?

Currently, the Lead Image is not required. This is by design, correct?

Help Text for Credit and Cutline

Can we add some help text for the Credit and Cutline fields? There will be users who may not be familiar with how these should be used.

File Upload Max Size

The upload maximum file size is set at 10MB. We have defined a max of 40MB here: #62. We can raise or lower 40MB, but I think we should maintain consistency across the CMS.

Markup for Images with Captions

In the event a Lead Image has a caption, shouldn't we switch to using <figure> and <figcaption>?

Recent News View

Exclude Current Node

Use a contextual filter in the view to exclude the current node.

Increase accessibility of 'more' link

Currently a screen reader will run across the 'more' link and read it without supporting context. We can increase the accessibility of this link with something like:

- <a href="/news">more</a>
+ <a href="/news">more<span class="visually-hidden">news items</span></a>

Cache Bubbling

I checked that cache bubbling is working with the view being rendered programmatically, and cache tags for news items are being added, so we're good here.

Layout Builder Views Block

When using the Views block plugin provided by Layout Builder, the user has the option to override the items displayed value. I think we should consider writing custom block plugins on a view-by-view basis so we can control the UI: Create a custom block. There will probably be instances where we want to add additional configuration to Views blocks, as well. (In D7 Panels/Panelizer, I used CTools content types for this purpose, and it worked well.)

macburgee1 commented 4 years ago

Coder review of PR code:

web/themes/custom/unl_five_herbie/unl_five_herbie.theme
  65 | WARNING | [ ] Line exceeds 80 characters; contains 88 characters
  66 | WARNING | [ ] Line exceeds 80 characters; contains 89 characters
  71 | ERROR   | [x] Namespaced classes/interfaces/traits should be referenced
     |         |     with use statements
 222 | WARNING | [ ] Line exceeds 80 characters; contains 98 characters
 235 | WARNING | [ ] Line exceeds 80 characters; contains 81 characters
 236 | WARNING | [ ] Line exceeds 80 characters; contains 84 characters