[TYPO3-calendar] Hide prev/next links in month view, if out of range
Ben Robinson
robinson2.ben at gmail.com
Tue May 23 17:51:27 CEST 2017
Hello, everybody.
is it possible to hide the prev and next links of the month view (###PREV_MONTHLINK### / ###NEXT_MONTHLINK###) if they are not in the given time range (start/endLinkRange)?
Also I would like to get old results out of the search engine's index.
I already found out that there's a hard coded "additionalHeaderData", if a page is not in the given range:
Classes/Controller/Controller.php - line 287:
if ($this->conf ['getdate'] <= date ('Ymd', strtotime ($this->conf ['view.'] ['startLinkRange'])) || $this->conf ['getdate'] >= date ('Ymd', strtotime ($this->conf ['view.'] ['endLinkRange']))) {
// Set additional META-Tag for google et al
$GLOBALS ['TSFE']->additionalHeaderData ['cal'] = '<meta name="robots" content="index,nofollow" />';
// Set / override no_search for current page-object
$GLOBALS ['TSFE']->page ['no_search'] = 0;
}
But I'm already usinig …
page.meta.robots = index, follow
[page|no_search = 1]
page.meta.robots = noindex, nofollow
[global]
… so the additionalHeaderData creates an additional robots-meta-tag.
Is it possible to override my TypoScript via Controller.php or define a constant, which could be used to extend my TS-condition? For example:
$GLOBALS ['TSFE']->page ['cal_out_of_range'] = 1;
[page|no_search = 1] || [page|cal_out_of_range= 1]
page.meta.robots = noindex, nofollow
[global]
(the example does not work, unfortunately)
Thanks for your help.
Ben
More information about the TYPO3-project-calendar
mailing list