[TYPO3-ttnews] linking single news record from own extension (cHash)
Ernesto Baschny [cron IT]
ernst at cron-it.de
Wed Jul 12 10:42:11 CEST 2006
Martin Clewing schrieb am 11.07.2006 10:14:
> I stumbled over a little (hopefully) problem: how can I link a single
> news from within an extension?
>
> I managed to link a news-entry when I disable cashing, but (of course) I
> need caching for indexed search, so this is no option.
>
> In other words: how do I create the cHash? Is there any way to do that
> at all? I looked into the tt_news extension, hoping to find the clue,
> but it's slightly beyond my horizon... which fields go into PiVars?
>
> The solution I found in this list (posted a year ago) was this:
> including a link-field in my extension where the news-articles url is
> inserted. That is not as comfortable as I would like it to be AND
> excludes any hide/timestamp/archive-functionality, which is really a
> great loss.
>
> Any ideas/help/solutions maybe?
You should use the "typolink" function to create the link. Just pass it
the correct $conf:
- parameter: the page-id where to display the single news
- additionalParams: the parameters just like tt_news does it
- and: useCacheHash=TRUE so it will generate the corresponding cHash.
Note that you need to use the exact same parameters as tt_news, else the
cHash will differ.
Documentation for the typolink function:
http://typo3.org/documentation/document-library/references/doc_core_tsref/current/view/5/8/
Call it through a valid cObj.
Cheers,
Ernesto
More information about the TYPO3-project-tt-news
mailing list