Newscoop 4 Cookbook

Publication

Newscoop content is organized in a hierarchical structure which conforms to the tradition of newspapers and magazines: publications, issues, sections and articles. Each publication is made up of issues, each issue is in turn made up of sections, which are comprised of articles.

In this chapter we'll look at how publication settings can be set in the admin interface and then accessed by $gimme->publication and its variants.

Configure Publication view for general attributes and comments in the administration interface

You can set a range of parameters in the configuration when creating or editing a publication in the administration interface. This chapter will explain only those parameters related to the $gimme->publication object through the template language.

Each publication has an attributes menu (accessible in the administration interface under Content->Publication and then by clicking on the wrench-and-screwdriver icon for configure).

There are three sections in the publication attributes menu for each publication:

  • General attributes and Comments on the left side of the menu
  • Subscription defaults on the right side of the menu

General Attributes

The fields in the general attributes section present in $gimme->publication are listed below:

Name of the publication (e.g. "The Journal")

{{ $gimme->publication->name }} 

Default Site Alias is the name of the web server on which your publication will be hosted (e.g. www.example.com). Newscoop enables multiple publications to be hosted on the same web server, provided that a unique alias has been set up for each publication by your system administrator. If you try to access the alias URL before this setting is made, you will see an error message indicating that the alias was not yet assigned to a publication.

{{ $gimme->publication->site }} 

Here is an example using $gimme->publication->site taken from The Journal's _tpl/_html-head.tpl:

<script type="text/javascript"> var tb_pathToImage = 'http://{{ $gimme->publication->site }}/templates/set_thejournal/_img/loadingAnimation.gif'; </script> <script type="text/javascript" src="http://{{ $gimme->publication->site }}/templates/set_thejournal/_js/tabs.js"></script> <script type="text/javascript" src="http://{{ $gimme->publication->site }}/templates/set_thejournal/_js/scripts.js"></script> <script type="text/javascript" src="http://{{ $gimme->publication->site }}/templates/set_thejournal/_js/easing.js"></script> <link rel="index" title="The Journal" href="http://{{ $gimme->publication->site }}"> 

$gimme->publication->default_language returns information related to the publication's default language. Here are a few examples:

<ul>     <li>name: {{ $gimme->publication->default_language->name }}         is the language name</li>     <li>number: {{ $gimme->publication->default_language->number }}         is language identifier in the Newscoop database (integer value)</li>     <li>english_name: {{ $gimme->publication->default_language->english_name }}         is language name in English</li>     <li>code: {{ $gimme->publication->default_language->code }}         is language international code</li>     <li>defined: {{ if $gimme->publication->default_language->defined }}SET{{ else }}NOT SET{{ /if }}         is boolean value (true/false) - true if the language was set in the current environment; false otherwise</li> </ul> 

A full reference to all properties of the template objects is given at the end of this book. The examples covered here might not cover all possibilities.

Comments

The fields in the Comments section in the screenshot above are accessible through $gimme->publication as follows:

Public allowed to comment? Check this box if non-subscribers will be allowed to make comments on articles

{{ if $gimme->publication->public_comments }}YES{{ /if }} 

Public comments moderated? If you check this box, non-subscriber comments will be hidden from readers until they have been reviewed by a staff member

{{ if $gimme->publication->captcha_enabled }}CAPTCHA{{ /if }} 

You can see some of these examples in action in the advanced section of this Cookbook.

Subscription Defaults

The rest of the fields are related to subscriptions, which you can adjust later if you wish. First, you have to select a time unit for your subscriptions; which could be days, months, weeks or years.

Configure Subscription default view in the administration interface 

You can set two types of subscriptions: paid and trial. Paid subscriptions have the following properties:

  • Currency: the subscription currency. Even if a subscription request is sent and the currency setting is changed before payment, the information about the subscriber's payment due is correctly recorded
  • Time unit cost per one section:
    • for one language: the price for access to a particular section in a single language
    • for all languages: the price for access to a section in all available languages
  • Default time period: the usual duration of the paid subscription. This value is used when a reader subscribes through the website. The period for a particular subscription can be modified from the administration interface

Here is some sample code for subscriptions:

<h3>Subscriptions</h3> <ul>     <li>Trial subscription: {{ $gimme->publication->subscription_trial_time }} {{ $gimme->publication->subscription_time_unit }}</li>     <li>Paid subscription: {{ $gimme->publication->subscription_paid_time }} {{ $gimme->publication->subscription_time_unit }}</li> </ul> <h4>Subscription costs:</h4> <ul>     <li>{{ $gimme->publication->subscription_currency }} {{ $gimme->publication->subscription_unit_cost }} (access one language)</li>     <li>{{ $gimme->publication->subscription_currency }} {{ $gimme->publication->subscription_unit_cost_all_lang }} (access all languages)</li> </ul> 

Controlling access based on subscriptions is described in the chapter titled "Subscriptions, Registration and Content Access."