Page 1 of 1

Get alias of current page

Posted: Tue Oct 30, 2012 3:12 pm
by aldomoro
I tried to show different header for every page of site but only found to show different header for level 1 (using CGSimpleSmarty):

Code: Select all

<div id="header" style="background-image: url(/uploads/Panoramica/header_{$cgsimple->get_root_alias()}.jpg);">
There is no function like "get_page_alias". Can anybody help me with some other way? Thank you.

Re: Get alias of current page

Posted: Tue Oct 30, 2012 3:41 pm
by Rolf
{$page_alias}

Re: Get alias of current page

Posted: Wed Oct 31, 2012 7:07 am
by aldomoro
Rolf wrote:{$page_alias}
Thank you. Simple but no chance to find it... I have tried it.

Re: Get alias of current page

Posted: Fri Nov 02, 2012 11:25 am
by Jos
aldomoro wrote:Simple but no chance to find it...
You can use {get_template_vars} to retrieve all the available variables

Re: Get alias of current page

Posted: Mon Jan 28, 2013 5:52 pm
by Dr.CSS
The {$page_alias} tag will output the alias of the page you are on and alias' that have 2 words are separated by a - so make sure your images are named the same way, if you put the tag in a content block or straight in the template it should show the page alias...