Language menu -> how to get the path of the current page
Permalink
Hi,
I need help with a language menu.
I just want to show which language is active on the current page.
therefore I want to check the path of the current page, if the page is a child of "deutsch" or "english", I have three levels in my tree, so the current page could be two levels under "deutsch" or "english".
So far I have written this:
What I don't know is how to get the variable $parentpage.
Any help appreciated. :)
I need help with a language menu.
I just want to show which language is active on the current page.
therefore I want to check the path of the current page, if the page is a child of "deutsch" or "english", I have three levels in my tree, so the current page could be two levels under "deutsch" or "english".
So far I have written this:
<?php $c = Page::getCurrentPage(); echo $c; if($parentpage == 'deutsch') { echo ('<a href="http://localhost:8888/concrete5/deutsch" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage(\'deutsch\',\'\',\'').$this->getThemePath().('/pics-menu/oe-aktiv.jpg\',1)\"><img src="').$this->getThemePath().('/pics-menu/oe-aktiv.jpg" alt="Deutsch" name="deutsch" width="21" height="25" border="0"></a>'); } else { echo ('<a href="http://localhost:8888/concrete5/deutsch" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage(\'deutsch\',\'\',\'').$this->getThemePath().('/pics-menu/oe-aktiv.jpg\',1)\"><img src="').$this->getThemePath().('/pics-menu/oe-inaktiv.jpg" alt="Deutsch" name="deutsch" width="21" height="25" border="0"></a>'); } if($parentpage == 'English') { echo ('<a href="http://localhost:8888/concrete5/english" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage(\'English\',\'\',\'').$this->getThemePath().('/pics-menu/e-aktiv.jpg\',1)"><img src="').$this->getThemePath().('/pics-menu/e-aktiv.jpg" alt="English" name="English" width="33" height="25" border="0"></a>'); } else { echo ('<a href="http://localhost:8888/concrete5/english" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage(\'English\',\'\',\'').$this->getThemePath().('/pics-menu/e-aktiv.jpg\',1)"><img src="').$this->getThemePath().('/pics-menu/e-inaktiv.jpg" alt="English" name="English" width="33" height="25" border="0"></a>'); }
Viewing 15 lines of 16 lines. View entire code block.
What I don't know is how to get the variable $parentpage.
Any help appreciated. :)
don't know why i didn't found it at first. :(