paywall_invoker:declarative
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| paywall_invoker:declarative [2023/11/07 10:09] – [data-paperview-paywall] joaosaraiva | paywall_invoker:declarative [2026/03/27 17:24] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | ====== Paywall declarative invocation ====== | ||
| + | The Paperview Paywall can be invoked by declaring regular HTML5 data attributes in HTML DOM elements -- such as '' | ||
| + | |||
| + | In the declarative invocation, the Paywall javascript -- loaded by a script inserted somewhere in your web page (see [[paywall_invoker: | ||
| + | |||
| + | The following is an example of a '' | ||
| + | <code html> | ||
| + | <div data-paperview-publication=" | ||
| + | </ | ||
| + | </ | ||
| + | |||
| + | Within the HTML element, you can place any content you wish; the content will be replaced with the article' | ||
| + | |||
| + | ===== Data attributes ===== | ||
| + | |||
| + | This is a complete list of the data attributes supported by the Paywall script. Note that all attributes are prefixed with '' | ||
| + | |||
| + | ==== data-paperview-publication ==== | ||
| + | |||
| + | The Publication ID for the Publication which provides the desired article, bundles, or subscriptions. This attribute is **always mandatory**, | ||
| + | |||
| + | ==== data-paperview-article ==== | ||
| + | |||
| + | The Article ID for the desired article.\\ | ||
| + | If this is provided, the Paywall will show the article acquisition screen, along with the possibility to acquire any bundles in which the article is included. Otherwise, only the Publication' | ||
| + | |||
| + | ==== data-paperview-content ==== | ||
| + | |||
| + | An integer (starting at 1), indicating that the DOM element will contain the specified piece of the article' | ||
| + | |||
| + | ==== data-paperview-referrer ==== | ||
| + | |||
| + | The ID of the Reader that referred the current Reader to this article (and Paywall).\\ | ||
| + | In most cases, this attribute will not be used, and the referrer will be determined from the current URL instead. | ||
| + | |||
| + | ==== data-paperview-seller ==== | ||
| + | |||
| + | The ID of the Reseller that is " | ||
| + | |||
| + | ==== data-paperview-reading-token ==== | ||
| + | |||
| + | A [[reading_token_provider: | ||
| + | This attribute can be used in a DOM element on its own (without needing the [[# | ||
| + | |||
| + | ==== data-paperview-roauth-token ==== | ||
| + | |||
| + | A ROAuth token to automatically login the Reader. This can be used to enable single sign-on (SSO) scenarios.\\ | ||
| + | This attribute can be used in a DOM element on its own (without needing the [[# | ||
| + | ==== data-paperview-paywall ==== | ||
| + | |||
| + | The Paywall workflow to be used. Can be one of '' | ||
| + | |||
| + | ==== data-paperview-except ==== | ||
| + | |||
| + | A comma-separated list of Paywall screens that should be hidden from the Reader. The screens available are '' | ||
| + | |||
| + | * '' | ||
| + | * '' | ||
| + | * '' | ||
| + | * '' | ||
| + | * '' | ||
| + | |||
| + | An example for a Paywall that should **only** display the article acquisition screen would be: '' | ||
| + | |||
| + | ==== data-paperview-publisher-transaction-token ==== | ||
| + | |||
| + | A Publisher-specific token that should be associated with any transaction that is performed during this paywall interaction. Can be used by the Publisher to associate purchases (such as subscriptions) with other information that has previously been collected by the Publisher. | ||
| + | |||
| + | ==== data-paperview-trigger ==== | ||
| + | |||
| + | What should trigger the Paywall' | ||
| + | |||
| + | * '' | ||
| + | * '' | ||
| + | * '' | ||
| + | * If the element is of type '' | ||
| + | * Otherwise, it will be that of '' | ||
| + | |||
| + | ==== data-paperview-replace ==== | ||
| + | |||
| + | What part of the declarative HTML DOM element should be replaced by the article content. Can be one of '' | ||
| + | |||
| + | * '' | ||
| + | * '' | ||
| + | |||
| + | ==== data-paperview-go-back-on-close ==== | ||
| + | |||
| + | Whether the Paywall should go back to the previous page if it is manually closed by the Reader. If the trigger is '' | ||
| + | |||
| + | ==== data-paperview-skip-intro ==== | ||
| + | |||
| + | Whether **anonymous** Readers should **not** view the initial text explaining that they need a Paperview account in order to acquire an article, bundle, or subscription. Authenticated Readers will not view that message.\\ | ||
| + | Any " | ||
| + | |||
| + | ==== data-paperview-element-set ==== | ||
| + | |||
| + | Indicates the element set to which this DOM element belongs. | ||
| + | |||
| + | An element set is used to aggregate multiple DOM elements into a single set, regardless of the other data attributes present in the element. This allows a developer to include Paywalls to multiple articles in the same web page, for example. | ||
| + | |||
| + | If this attribute is not provided, the element belongs to a set identified by the [[# | ||
