Page 1 of 1

{pagealias} tag

Posted: Thu Sep 06, 2007 10:17 pm
by Maticomp
Simple, yet sometimes useful (for example to provide css styling dependent on currently viewed page) tag. Maybe used standalone or put into user defined tags:

(file function.pagealias.php)

variables['pageinfo'];
$config = &$gCms->GetConfig();
if (isset($pageinfo) && $pageinfo->content_id == -1)
{
#We've a custom error message...  set a current timestamp
return "404 Error";
}
else
{
$result = cms_htmlentities($pageinfo->content_alias);
if (!(isset($config["use_smarty_php_tags"]) && $config["use_smarty_php_tags"] == true))
{
$result = ereg_replace("\{\/?php\}", "", $result);
}
return $result;
}
}

function smarty_cms_help_function_pagealias() {
?>
What does this do?
Prints the alias of the page.
How do I use it?
Just insert the tag into your template/page like: {pagealias}
What parameters does it take?
None at this time.

Alternation: Mateusz Papiernik<mati@maticomp.net>
        Author: Ted Kulp<tedkulp@users.sf.net>
Version: 1.0

Change History:
Displays page alias instead of title.


Re: {pagealias} tag

Posted: Thu Sep 06, 2007 10:30 pm
by cyberman
Thanks for the tag but think {$page_alias} does the same  ;).

Re: {pagealias} tag

Posted: Thu Sep 06, 2007 10:34 pm
by Maticomp
Oh damn! :) You're right. It's too late for me to be working ;) Simpliest solutions don't come to my mind and I have to smash through open doors...