Don't use $_GET within Contao. Use
PHP Code:
\Input::get('key');
\Input::get('auto_item');
You also can get page properties
PHP Code:
global $objPage;
echo $objPage-alias;
dump($objPage);
Or with a Model (Maybe you will get some different values with $objPage and \PageModel. Consider that the news detail pages are not stored within DB.tl_page.)
PHP Code:
global $objPage;
$pageModelObject = \PageModel::findByPk($objPage->id);
echo $pageModelObject->alias;
dump($pageModelObject);
You also easily can find a news Model bei page alias
PHP Code:
$pageAlias = \Input::get('auto_item');
$newsModelObj = \NewsModel::findByAlias($pageAlias);
// Within your list template
if($this->id === $newsModelObj->id)
{
}
All untested.
Bookmarks