简体   繁体   中英

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". This register does contain the singlePid of the contentelement (defined a single view page) and the uid of the newsarticle from the news extension.

This is the typoscript section of the "new ts" of the extension tt_news As you can see there is "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"? 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". 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

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)

My question is: Where is the "register:newsMoreLink" defined? Is it defined generally or do I miss a fact of Typo3..? How can I add an anchor link at the end of this "More >" href? Like:

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. It's one of the data types . In other words a type of data that you can access with stdWrap.data . register is set with LOAD_REGISTER . Though, in case of tt_news this is set in the PHP code with $this->local_cObj->LOAD_REGISTER() .

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 :

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

You shall be interested in the typolink's attributes parameter , additionalParams and section .

this is the code I use to link to an pid with a anchor target:

        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
            }
        }

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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