简体   繁体   English

tt_news - 定义寄存器“newsMoreLink”在哪里?

[英]tt_news - where is the register “newsMoreLink” be defined?

The extension tt_news is very useful for me but there is this little thingy called "register:newsMoreLink". 扩展名tt_news对我来说非常有用,但有一个叫做“register:newsMoreLink”的小东西。 This register does contain the singlePid of the contentelement (defined a single view page) and the uid of the newsarticle from the news extension. 该寄存器确实包含contentelement的singlePid(定义了单个视图页面)和来自新闻扩展的newsarticle的uid。

This is the typoscript section of the "new ts" of the extension tt_news As you can see there is "append.data = register:newsMoreLink"... 这是扩展名tt_news的“新ts”的typoscript部分你可以看到有“append.data = register:newsMoreLink”......

plugin.tt_news {
displayLatest {
subheader_stdWrap {
# the "more" link is directly appended to the subheader
      append = TEXT
  append.data = register:newsMoreLink
      append.wrap = <span class="news-list-morelink">|</span>
      # display the "more" link only if the field bodytext contains something
      append.if.isTrue.field = bodytext
      outerWrap = <p>|</p>
}
}
}

What is "register:newsMoreLink"? 什么是“register:newsMoreLink”? Is this like a function or something? 这是一个功能还是什么? I do not know. 我不知道。 But "register:newsMoreLink" produces a strange link if I use this on "append.data". 但是“register:newsMoreLink”会产生一个奇怪的链接,如果我在“append.data”上使用它。 It produces are "More >" link. 它产生的是“更多>”链接。 The "More >" link after a news article teaser looks like this: 新闻文章预告片之后的“更多>” 链接如下所示:

http://192.168.1.29/website/index.php?id= 474 &tx_ttnews%5Btt_news%5D= 24 &cHash=95d80a09fb9cbade7e934cda5e14e00a http://192.168.1.29/website/index.php?id= 474 &tx_ttnews%5Btt_news%5D = 24 &cHash = 95d80a09fb9cbade7e934cda5e14e00a

474 is the "singlePid" (this is what it calls in the database 24 is the "uid" of the news article (the ones you create with the tt_news plugin in the backend) 474是“singlePid”(这是它在数据库24中调用的是新闻文章的“uid”(你在后端使用tt_news插件创建的那篇)

My question is: Where is the "register:newsMoreLink" defined? 我的问题是:“register:newsMoreLink”定义在哪里? Is it defined generally or do I miss a fact of Typo3..? 它是一般定义还是我错过了Typo3的事实..? How can I add an anchor link at the end of this "More >" href? 如何在“More>”href的末尾添加锚链接? Like: 喜欢:

http://192.168.1.29/website/index.php?id=474&tx_ttnews%5Btt_news%5D=24&cHash=95d80a09fb9cbade7e934cda5e14e00a #myAnchor1 http://192.168.1.29/website/index.php?id=474&tx_ttnews%5Btt_news%5D=24&cHash=95d80a09fb9cbade7e934cda5e14e00a #myAnchor1

register:newsMoreLink is not a function. register:newsMoreLink不是一个函数。 It's one of the data types . 它是数据类型之一 In other words a type of data that you can access with stdWrap.data . 换句话说,您可以使用stdWrap.data访问的数据类型。 register is set with LOAD_REGISTER . 寄存器设置为LOAD_REGISTER Though, in case of tt_news this is set in the PHP code with $this->local_cObj->LOAD_REGISTER() . 但是,在tt_news的情况下,这是使用$this->local_cObj->LOAD_REGISTER()在PHP代码中设置的。

I'm afraid you cannot easily add an anchor to that link. 我担心你不能轻易地将锚添加到该链接。 However, you can set the append to create your own custom link to the news record using typolink : 但是,您可以使用typolink append设置为创建自己的新闻记录自定义链接:

append = TEXT
append {
  value = text of the link
  typolink {
    # ...typolink configuration...
  }
}

You shall be interested in the typolink's attributes parameter , additionalParams and section . 您应该对typolink的属性parameteradditionalParamssection感兴趣。

this is the code I use to link to an pid with a anchor target: 这是我用来链接到带锚目标的pid的代码:

        displayList.plugin.tt_news.subheader_stdWrap {  

        append = TEXT
        append.data >
        append {
            value = mehr
            typolink{
                parameter = 47 // pid
                section  = entry_{field:uid} // anchor name
                section.insertData = 1
            }
        }

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM