Publisher (deprecated)

Through the Publisher module Seagull allows you to create three types of content. This is easily customisable however only 3 types will be discussed here:

  • What you see when you click the 'Articles' tab in the front end is a document collection. Creating articles of type 'Html Article' allows you to place your content in a hierarchy that you build using the 'Categories' button above. This can be useful for intranet applications, or if you have a large body of work that needs to be categorised. Document collection articles will be displayed with all articles from the same category appearing in the 'Related Articles' box on the right. Similarly, all files uploaded to the same category with the Document Manager? will appear in the 'Related Documents' box.
  • However, if you want to make standalone pages that will be linked to by their own tab, please use the 'Static Html Article' type. In order to create the navigation that will link to these static pages, please use the Navigation module.
  • Finally, you can create news items by choosing the News Item type, these will appear in the left hand column in the Site News box. These articles (and all others) can be retired automatically according to the date constraints you set on the item.

Content Item Management using SGL_Item

This is only a couple examples on how to use SGL_Item please look at [lib/SGL/SGL_Item.php] for a complete overview of functionality.

Retrieving Content Items

Retrieving a Single Content Item

See: Code Example ArticleViewMgr::_view(), API Doc SGL_Item.php::getItemDetail()

$ret = SGL_Item::getItemDetail($input->articleID, null, $input->articleLang);

Paginated Content Items

See: Code Example ArticleViewMgr::_summary(), API Doc SGL_Item.php::retrievePaginated()

$aResult = SGL_Item::retrievePaginated(
    $input->catID,
    $bPublish = true,
    $input->dataTypeID,
    '',
    $input->from,
    'start_date');

Expanding Content Items

Adding a new Content Item

It's very easy to add a new item category to publisher for storing content.

For example i recently had one for weather reports:

  • <title>
  • <minimum>
  • <maximum>
  • <prediction>

To do your own:

  1. add a new Content Type using ContentTypeMgr.php (disabled until 0.4)
    • to enable it just go to <your domain>/index.php/publisher/contentType/
  2. you can add new content types using a comfortable form.
  3. if you want the category chooser to be displayed in add method you have to hack it in in trunk/modules/publisher/classes/articleMgr.php on line 181, e.g. if ($input->dataTypeID == 2 }| $input->dataTypeID == 6 || $input->dataTypeID == 7)
  4. same in edit method (line 302) and to update method
  5. in SGL_Item::generateItemOutput() create a case statement that corresponds to the id created in step 1, following the example of the others, you'll see it's quite simple.

note: the number of line can be different depending on the version

note: your item must contain a field called "title", otherwise it won't be cought by SGL_Item::retrievePaginated()