mediadreams/md_news_author

为 tx_news 记录添加一个或多个作者,显示所有作者列表,并显示包含所附新闻条目的作者详细页面。

安装次数: 21,223

依赖: 1

推荐: 0

安全: 0

星级: 4

关注者: 3

分支: 4

开放问题: 0

类型:typo3-cms-extension

v7.0.2 2024-02-02 15:37 UTC

README

此扩展基于 extbase & fluid,并提供了乔治·林格(Georg Ringer)的著名扩展 ext:news(感谢你,@georgringer!),支持一个或多个作者。您可以在中央管理作者并将它们附加到新闻记录。扩展包括两个插件,一个用于列出所有作者,另一个用于作者详情页面,该页面还显示了选定作者的新闻记录。

要求

  • TYPO3 >= 11.5
  • ext:news >= 9.0
  • ext:numbered_pagination >= 1.0.1

安装

  • 使用扩展管理器安装扩展,或使用 composer(composer req mediadreams/md_news_author
  • 包含扩展的静态 TypoScript
  • 通过设置自己的常量来配置扩展

使用方法

创建作者并将它们附加到新闻记录

  • 在 sysfolder 上创建一些作者记录(使用列表模块,点击加号图标 创建新记录 并选择 新闻作者
  • 在 sysfolder 上创建新闻记录,并找到新的标签页 作者
  • 为新闻记录选择一个或多个作者
  • 保存并关闭

列出作者

插入所有作者的分页列表。

  • 在页面上创建一个插件 新闻作者:作者列表
  • 单个作者视图页面 选择单个作者视图页面
  • 选择存储作者记录的 sysfolder
  • 其他设置可以在标签页 列表视图设置 中找到
  • 如果需要,仅显示特定类别的作者(标签页 类别
  • 保存并关闭

作者详细页面

插入作者详细视图。此页面还包括与选定作者关联的所有新闻。

  • 在页面上创建一个插件 新闻作者:显示作者
  • 可选地,为 作者列表页面 选择包含所有作者列表的页面
  • 选择存储作者记录的 sysfolder
  • 其他设置可以在标签页 详细视图设置 中找到
  • 保存并关闭

ext:news 视图中显示作者

  • 使用 {newsItem.newsAuthor} 在新闻记录中访问作者属性。由于一个新闻记录可能附加了多个作者,您需要迭代
<f:for each="{newsItem.newsAuthor}" as="author">
    {md:ShowAuthorName(author: author)}
    {author.phone}
    {author. ...}
</f:for>
  • 添加到个人资料页面的链接

不要忘记加载视图助手 {namespace md=Mediadreams\MdNewsAuthor\ViewHelpers}

<f:for each="{newsItem.newsAuthor}" as="author">
    <f:link.action action="show" controller="NewsAuthor" extensionName="mdnewsauthor" pluginName="show" arguments="{newsAuthor: author}" pageUid="{settings.newsAuthor.authorDetailPid}" title="More about {md:ShowAuthorName(author:'{author}')}">
        <md:ShowAuthorName author="{author}" />
    </f:link.action>
</f:for>

页面 TSconfig

为了在新闻记录的“作者”标签页中仅显示单个页面的作者,您可以使用以下 TSconfig

TCEFORM.tx_news_domain_model_news.news_author.PAGE_TSCONFIG_STR = 1

这将仅显示存储在页面 ID = 1 的作者记录

路由增强器

routeEnhancers:
  NewsAuthorList:
    type: Extbase
    extension: MdNewsAuthor
    plugin: list
    routes:
      -
        routePath: 'page-{page}'
        _controller: 'NewsAuthor::list'
        _arguments:
          slug: 'newsAuthor'
          page: 'currentPage'
      -
        routePath: '/a-z/{letter}'
        _controller: 'NewsAuthor::list'
        _arguments:
          'letter': 'selectedLetter'
    defaultController: 'NewsAuthor::list'
    requirements:
      page: '\d+'
    defaults:
      page: '0'
    aspects:
      page:
        type: StaticRangeMapper
        start: '1'
        end: '100'
      letter:
        type: StaticValueMapper
        map:
          a: A
          b: B
          c: C
          d: D
          e: E
          f: F
          g: G
          h: H
          i: I
          j: J
          k: K
          l: L
          m: M
          n: N
          o: O
          p: P
          q: Q
          r: R
          s: S
          t: T
          u: U
          v: V
          w: W
          x: X
          y: Y
          z: Z
  NewsAuthorShow:
    type: Extbase
    extension: MdNewsAuthor
    plugin: show
    routes:
      - 
        routePath: '{slug}'
        _controller: 'NewsAuthor::show'
        _arguments:
          slug: 'newsAuthor'
      -
        routePath: '{slug}/articles-{page}'
        _controller: 'NewsAuthor::show'
        _arguments:
          slug: 'newsAuthor'
          page: 'currentPage'
    defaultController: 'NewsAuthor::show'
    requirements:
      slug: '^[a-zA-Z0-9].*$'
      page: '\d+'
    defaults:
      page: '0'
    aspects:
      slug:
        type: PersistedAliasMapper
        tableName: 'tx_mdnewsauthor_domain_model_newsauthor'
        routeFieldName: 'slug'
      page:
        type: StaticRangeMapper
        start: '1'
        end: '100'

错误和已知问题

如果您发现错误,请在 Github 上添加问题。

感谢

非常感谢所有使这个出色的 TYPO3 项目成为可能的人!

致谢

扩展图标由 Font Awesome 提供。