News Module in Typolight: add year and month in the url

/ Published in: PHP
Save to your folder(s)

I added this code in the ModuleNews.php file on line 310 - 314.

Copy this code and paste it in your HTML
  1. //print_r(date('Y',$objArticle->date));
  2. setlocale(LC_TIME, "de_DE");
  3. $monat = strftime('%B',$objArticle->date);
  4. if ($monat == 'März') $monat = 'Maerz';
  5. $strUrl = ampersand($this->generateFrontendUrl($objPage->fetchAssoc(), '/'.date('Y',$objArticle->date).'/'.$monat.'/items/' . ((!$GLOBALS['TL_CONFIG']['disableAlias'] && strlen($objArticle->alias)) ? $objArticle->alias : $objArticle->id))/*.'?year=2009'*/);

Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.