Sourcefabric Manuals

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

Newscoop 4.2 Cookbook

Author and author biography

Author

Note: this works only in Newscoop 3.5.0 and newer versions.

The article author object is usually initialized inside a list of article authors. It is also always possible to access this object for the current article in the environment (see "Article"). It is not initialized at the beginning of the template and can not be initialized by other Newscoop functions. The article author object has the following properties:

  • first_name: the author's first name
  • last_name: the author's last name
  • name: the author's full name
  • email: the author's e-mail address
  • type: the author type
  • biography: the author biography - see "Author Biography" object
  • picture: the author picture - see "Image" object
  • defined: boolean value (true/false) - true if the author was set in the current environment; false otherwise

Examples

{{ list_article_authors order="bylastname" }}
 <p class="author-head">
  {{ $gimme->author->type }}: {{ $gimme->author->name }}
 </p>
 <p class="author-bio">
  <img src="{{ $gimme->author->picture->imageurl }}" class="author-pic">
  {{ $gimme->author->biography->text }}
 </p>
{{ /list_article_authors }}
{{ if $gimme->article->defined }} by
 {{ $gimme->article->author->first_name }}
  {{ $gimme->article->author->last_name }}
   {{ $gimme->article->author->type }}
{{ /if }}

Author Biography

Note: this works only in Newscoop 3.5.0 and newer versions.

The author biography object is usually initialized within the "Author" object. It is not a main object as it can only be used through the "Author" object. Also, it is not initialized at the beginning of the template and cannot be initialized by other Newscoop functions. The author biography object has the following properties:

  • first_name: the translated author's first name
  • last_name: the translated author's last name
  • name: the translated author's full name
  • text: the translated author's biography
  • defined: boolean value (true/false) - true if the author biography was set in the current environment; false otherwise

Example

{{ if $gimme->article->defined }} by
 {{ $gimme->article->author->biography->name }}
  ({{ $gimme->article->author->type }})<br />
   <p>{{ $gimme->article->author->biography->text }}</p>
{{ /if }}

There has been error in communication with Booktype server. Not sure right now where is the problem.

You should refresh this page.