Sourcefabric Manuals

 English |  Español |  Français |  Italiano |  Português |  Русский |  Shqip

Newscoop 4.2 Cookbook

Subscription form

Form - Subscription

Purpose:

Generate the form and default data fields for subscription. Edit and Select statements can be used to generate fields for every section in an issue.

Syntax:

{{ subscription_form type="<subscription_type>"
                          [template="<template_name>"]
                          submit_button="<button_name>"
                          [total="<total_field_name>"]
                          [html_code="<html_code>"]
                          [button_html_code="<html_code>"] }}
   <list_of_instructions>
{{ /subscription_form }}
  • <subscription_type> has two values: by_publication and by_section
  • <template_name> is the name of the next template to be requested from the subscription form
  • <button_name> is the name of the button for submitting the form
  • <total_field_name> is the name of the field where the total payment is written
  • <evaluate_button_name> is the name of the evaluate button (when pressing this button, the total payment is updated in the total field
  • html_code: you can insert whatever HTML code you want in the <form> statement; for example: {{ user_form .. html_code="id=\"my_id\"" }}
  • button_html_code: you can insert whatever HTML code you want in the button input field statement; such as: {{ user_form .. button_html_code="id=\"my_submit_id\"" }}

Constraints:

Cannot be used inside user and login forms. Cannot be used within itself (for example: subscription in subscription).

Edit Subscription

Purpose:

Generates an input field for editing the subscription time for a certain section. The section must be defined in the template environment. This statement should be used inside the subscription form.

Syntax:

{{ camp_edit object="search" attribute="time"
                             [html_code="<HTML_code>"]
                             [size ="<field_length>"] }}

Constraints:

The subscription edit field can only be used inside the subscription form.

Select Subscription

Purpose:

Special-purpose input for subscription data.

Syntax:

{{ camp_select object="subscription" attribute="<attribute>"
                                     [html_code="<HTML_code>"] }}

Filters:

<attribute> being one of the following:

  • section: generates a checkbox for selecting the current section in the subscription form; use together with "List of Sections" (see also "Creating reader subscriptions through the template language")
  • allLanguages: generates a checkbox allowing the user to choose a subscription to all available languages
  • languages: generates a multiple selection list allowing the user to select individual languages; this selection list is automatically deactivated if the user chose to subscribe to all available languages.

Constraints:

The select subscription field can only be used inside the subscription form.