Limit announcements shown in a region

Created on 5 November 2024, about 2 months ago

Problem/Motivation

We need the ability to limit the amount of announcements shown in a region.

Proposed resolution

Add a new "limit" field to the Region entity. Alter region block to take the "limit" field into account.

✨ Feature request
Status

Needs review

Version

2.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States edwardsay

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @edwardsay
  • πŸ‡ΊπŸ‡ΈUnited States richgerdes New Jersey, USA

    Hey @edwardsay,

    Thanks for the feature implementation. I think this is a great idea.

    Can you provide some more details on your use case? I think it sounds like you want to limit the number of items displayed in a list. It seems like since the availability of the announcements is determined dynamically based on the url and other conditions, you need to limit the number during selection/rendering to prevent too many items from being shown. Is this correct?

    I think this makes sense as a feature, but I have a few questions.

    1) Should the limits be set per block or per region. It seems like this likely should be moved to a block level setting instead of a region level setting, since regions can be reused by multiple blocks (say in a header and a sidebar) and you might want a different number of items displayed in each.

    2) If we do think the limit should be kept, I think we should move the filter into the `loadActiveForRegion()` method. This might ideally be a new function (say getAnnouncementsToDisplay(Region $region) ) that takes the region as a parameter instead of doing this in the block. This will make the feature more reusable.

  • πŸ‡ΊπŸ‡ΈUnited States richgerdes New Jersey, USA
Production build 0.71.5 2024