Get alias of current page

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Locked
aldomoro
Forum Members
Forum Members
Posts: 14
Joined: Wed Oct 17, 2012 7:50 am

Get alias of current page

Post 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.
User avatar
Rolf
Power Poster
Power Poster
Posts: 7825
Joined: Wed Apr 23, 2008 7:53 am
Location: The Netherlands
Contact:

Re: Get alias of current page

Post by Rolf »

{$page_alias}
- + - + - + - + - + - + -
LATEST TUTORIAL AT CMS CAN BE SIMPLE:
Migrating Company Directory module to LISE
- + - + - + - + - + - + -
Image
aldomoro
Forum Members
Forum Members
Posts: 14
Joined: Wed Oct 17, 2012 7:50 am

Re: Get alias of current page

Post by aldomoro »

Rolf wrote:{$page_alias}
Thank you. Simple but no chance to find it... I have tried it.
Jos
Support Guru
Support Guru
Posts: 4019
Joined: Wed Sep 05, 2007 8:03 pm
Location: The Netherlands

Re: Get alias of current page

Post by Jos »

aldomoro wrote:Simple but no chance to find it...
You can use {get_template_vars} to retrieve all the available variables
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am
Location: Arizona

Re: Get alias of current page

Post 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...
Locked

Return to “Modules/Add-Ons”