- Issue created by @edwardsay
- Merge request !4#3485752 Implement a way to limit announcements shown in a region β (Open) 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.