来源:http://trac.seagullproject.org/wiki/Modules/Publisher

Publisher模块

通过Publisher模块,Seagull允许创建三种类型的内容.虽然在此将只讨论三种类型,但它十分容易自定义。

  • 当你点击前端的‘文章'标签,你会看到文档集.创建'Html Article' 类型的文章允许将你的内容放置在一个层级里,这个层级是通过使用上面的'分类'按钮创建。作为企业内部互联网的应用程序,或如果有大量的工作需要加以分类,这是都是有用的.页面将会按相同类别将文档集的文章显示在右边的'文章'栏中。同样地,由档案管理器上传的相同类型的所有文件将会显示在'档案'栏中。
  • 然而,如果你想创建可让导航表链接的孤立页面,请使用'Static Html Article'类型。为了创建导航链接静态页面,请使用导航模块。
  • 最后,你可以通过选择News Item类型来创建新的Item,创建后它将会在左手边的”Site News”栏中显示。根据在Item中设置的时间限制,这些文章(和所有其它的)会到时自动失效.

使用SGL_Item管理内容Item

这只是一个关于如何使用SGL_Item简单的例子,如果想看看功能的完全概述,请浏览lib/SGL/SGL_Item.php

Retrieving Content Items

Retrieving a Single Content Item

查看:代码实例ArticleViewMgr::_view(),API文档SGL_Item.php::getItemDetail()

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

标页数的Content Items

查看:代码实例ArticleViewMgr::_summary(),API文档SGL_Item.php::retrievePaginated()

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

展开的Content Items

添加一个新的Content Item

给Publisher添加一个用来存放内容的分类是相当容易的. 例如:最近我需要一个天气报告的内容

  • <title标题>
  • <minimum最低温度>
  • <maximum最高温度>
  • <prediction预报>

你需要执行以下操作:

  • 使用ContentTypeMgr.php添加一个新的内容类型(到Seagull0.4版本就被停用了)
    • 只需要转到<your domain>/index.php/publisher/contentType/就可激活它
  • 可以使用一个舒适的表单,添加一个新的内容类型
  • 如果想要在添加方法中显示分类选择器,你必须租用它,trunk/modules/publisher/classes/articleMgr.php文件的第181行,例如:
if ($input->dataTypeID == 2 }| $input->dataTypeID == 6 || $input->dataTypeID == 7)
  • edit方法也是如此(第302行)
  • 步骤1时,在SGL_Item::generateItemOutput()中对应该已创建的ID创建一个条件语句,参考其它的例子,你会知道这是非常简单的.
 
modules/publisher.txt · 最后更改: 2010/05/30 00:21 (外部编辑)
 
Except where otherwise noted, content on this wiki is licensed under the following license:GNU Free Documentation License 1.2