Restrict visibility per content type

Created on 27 June 2022, over 2 years ago
Updated 16 January 2024, 12 months ago

Problem/Motivation

Sitewide alerts can be restricted by a list of routes. However when displaying them on admin pages, the routes are not always consistent and could be more accurately targeted through content types, similar to block visibility. For our use case, we mainly use these alerts on admin pages as it is a decoupled cms so the ability to target by content type would be helpful.

e.g. if I have an "Event" content type, i can easily set an alert to be visible on /node/add/event. However, any existing events (or after node save), that route is no longer /node/add/event but now node/[nid]/edit

Steps to reproduce

- Allow sitewide alerts to be visible on admin pages through config
- Create a sitewide alert and restrict it to the /node/add/event (or other content type)
- Visit /node/add/event and see the alert.
- Save the node, the alert will disappear (not a bug, as it is a different route now)

Proposed resolution

Add an option for restricting alerts by content types under an alert's visibility options. Can be conditionally visible similar to the current routes field. Thinking maybe a separate checkbox "Limit by Content Type" that then surfaces a checkbox list of available content types.

This would enable an alert to be set for the Event content type instead of a specific route, handling node/add/* and node/*/edit.

✨ Feature request
Status

Active

Version

2.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States tjh

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

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024