代码之家  ›  专栏  ›  技术社区  ›  lisardo

typo3,news:通过get参数更改排序顺序和方向

  •  1
  • lisardo  · 技术社区  · 6 年前

    在扩展新闻的列表视图中,我们需要更改排序顺序和排序方向的链接。是否有可能通过get参数同时更改这两个参数? 我取消选中了“禁用覆盖需求”选项,并尝试了一些组合,如

    ?tx_news_pi1[orderDirection]=asc
    ?tx_news_pi1[settings][orderDirection]=asc
    

    但这行不通。

    谢谢!

    4 回复  |  直到 6 年前
        1
  •  2
  •   Georg Ringer    6 年前

    tx_news_pi1[overwriteDemand][order]=title desc

        2
  •  0
  •   BastianBalthasarBux    6 年前

        3
  •  0
  •   David user10336229    6 年前


    1. #######
      ## Here you transfer the URL-parameters for sorting to the TypoScript-settings
      ## and also assure that only predefined values are accepted
      #######
      [globalVar = _GET|tx_news_pi1|orderBy = title]
          plugin.tx_news.settings.orderBy = title
      [globalVar = _GET|tx_news_pi1|orderBy = datetime]
          plugin.tx_news.settings.orderBy = datetime
      [globalVar = _GET|tx_news_pi1|orderBy = tstamp]
          plugin.tx_news.settings.orderBy = tstamp
      [globalVar = _GET|tx_news_pi1|orderBy = crdate]
          plugin.tx_news.settings.orderBy = crdate
      [global]
      
      [globalVar = _GET|tx_news_pi1|sort = desc]
          plugin.tx_news.settings.orderDirection = desc
      [else]
          plugin.tx_news.settings.orderDirection = asc
      [global]
      

      <f:link.action action="list" addQueryString="&tx_news_pi1[orderBy]=title&tx_news_pi1[sort]=asc">Sort by title: asc</f:link.action>
      <f:link.action action="list" addQueryString="&tx_news_pi1[orderBy]=title&tx_news_pi1[sort]=desc">Sort by title: desc</f:link.action>
      



      https://docs.typo3.org/typo3cms/extensions/news/DeveloperManual/ExtendNews/ExtendFlexforms/Index.html#selectbox-sort-by

    2. news-related extensions eventnews dataviewer

    AJAX based pagination

        4
  •  0
  •   lisardo    6 年前