Sourcefabric Manuals

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

Newscoop 4.1 Cookbook

Managing static pages

Newscoop doesn't have a special place for publishing static pages. There are different ways of handling static pages, depending on the requirements of your publication. You can park them in a separate publication, in a separate issue or a dedicated section.

A simple way of handling static pages is by using a specific Article Type - in our case "page" - and place pages in any issue or section you want. Then you can list those static pages like this:

<ul>
{{ list_articles ignore_issue="true" ignore_section="true" constraints="type is page" }}
  <li><a href="{{ url options="article" }}">{{ $gimme->article->name }}</a></li>
{{ /list_articles }}
</ul>

This will list all articles which are of the type "page", regardless of their issue or section.

A more sophisticated approach often seen in Newscoop implementations is to create a special issue, outside of the chronological ordering of "normal" issues. Most often that's issue number 1, with a structure and articles which are different from the rest of the publication.

For example, you could have issue number 1 with the name 'pages', and inside it the sections 'about' and 'legal'. To access the content in your publication, you would set the environment to the special issue, and by enclosing everything in {{ local }}...{{ /local }} you could ensure that general context of parameters is not changed.

{{ local }}
{{ set_issue number="1" }}
{{ list_sections }}

We have two sections, and want to create two subheads with section names, and then unordered lists with articles inside:

{{ list_articles constraints="type is page" }}
    {{ if $gimme->current_list->at_beginning }}
        <h3>{{ $gimme->section->name }}</h3>
        <ul>
    {{ /if }}

The subhead will be printed, and the unordered list opened only if the section has articles inside.

        <li><a href="{{ url options="article" }}">{{ $gimme->article->name }}</a></li>

In the code above, all the names of articles inside the section are made into links pointing to the full article pages.

        {{ if $gimme->current_list->at_end }}
        </ul>
        {{ /if }}

The code above will close the unordered list, once the last article is reached. Finally, the statements are closed, with the code below.

{{ /list_articles }}
{{ /list_sections }}
{{ /local }}

This way, editors of the publication have the option to independently update the content of these static pages. Keeping them in issue number 1, they can easily jump there with only one click from the issue listing page.

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

You should refresh this page.