backdrop-contrib / tca

Grant access to content using a URL access token on your Backdrop CMS website
https://backdropcms.org/project/tca
GNU General Public License v2.0
1 stars 1 forks source link

Expose to views with control over display #1

Closed yorkshire-pudding closed 3 months ago

yorkshire-pudding commented 3 months ago

While porting this module, I looked at the issues for the 7.x branch. Several of these issues appear worthy of being addressed in the Backdrop version.

The approach I've decided to take is as follows:

  1. Expose both the TCA status and token to views fields and status to filter (I couldn't think of any purpose for the token to be a filter Of course there is ! :facepalm: by adding to the filter I can then do a contextual filter so I only show the view if the token is in the URL)
  2. Create an override option at the Views display level to allow to override access for particular views

By allowing certain views to bypass the restriction, we can use contextual filters to display particular view blocks in the layout while preserving the protection of the node. As long as the information is carefully controlled, this gives maximum flexibility for site builders.

While I haven't created a dedicated block for the link, it is easy enough to create one that meets the site needs using a Views block display.