just another thing I never though we would work on… a paywall.
we're on the very first stages of the development and currently we don't block any content, just hide it.
this is how it works: the paywall is applied in a transform that modifies the response before publishing it. a configurable XPath expression is used to select the last element of the HTML DOM to be shown. by default, the second paragraph of the body text is the last element selected, and all its siblings will be hidden by applying a class to them.
a button is inserted as the last element of the body text. this button fires a JavaScript event that removed the class and hides the button itself.
the paywall is only applied to anonymous users.
small CSS and JavaScript snippets are also inserted on each item behind the firewall.
the use of an XPath expression means that the final result could be affected by the markup. we need to find out a way to validate this as part of a quality assurance process.
if you have a use case for this and want to talk about the implementation let me know.
code is here: https://github.com/collective/collective.behavior.paywall
it's compatible with all current versions of Plone including upcoming 5.1