{pagealias} tag

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
Maticomp
Forum Members
Forum Members
Posts: 12
Joined: Mon Oct 17, 2005 6:26 pm

{pagealias} tag

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

cyberman

Re: {pagealias} tag

Post by cyberman »

Thanks for the tag but think {$page_alias} does the same  ;).
Maticomp
Forum Members
Forum Members
Posts: 12
Joined: Mon Oct 17, 2005 6:26 pm

Re: {pagealias} tag

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

Return to “Modules/Add-Ons”