getAlias(); ?

Permalink
Hi,

I'd like to be able use the pages alias name in a theme php file (default.php or whatever). Is there a way to do something similar to <?=$this->getThemePath()?> but instead of returning the theme path have it return the pages alias name? So if I was using default.php and navigated to 'About Us' I could use something like <?=$this->getAlias()?> to insert 'about-us' in my theme file

Thanks

pvernaglia
 
JimboJetset replied on at Permalink Reply
JimboJetset
Not tested it but try this...
global $c
echo $c->getCollectionHandle();
pvernaglia replied on at Permalink Reply
pvernaglia
I get a syntax error when I try to use that. What I'm trying to do is set a div id to the pages alias name. Maybe there's an easier way that already exists?
JimboJetset replied on at Permalink Best Answer Reply
JimboJetset
sorry... there was a syntax error... I'd left out a semi-colon... see below... and it does work..
global $c; 
echo $c->getCollectionHandle();

...or for your purposes...

<?php global $c; ?>
<div id="<?=$c->getCollectionHandle()?>">
pvernaglia replied on at Permalink Reply
pvernaglia
Perfect! Thanks so much