Hello,
I hope that this is not already answered I did a search and nothing came up.
I am writing a plugin,
I would like to know if there is some simple that will return to me the alias of the current page that the user is on?
I have a picture on the home page of a site and I only want to show that picture if the user is seeing the home page with out making one template for just the home page and the another template for the rest of the pages.
Yes I have to picture in the template... trust me on this.
So far I have this:
if( $_GET['page'] == "home" )
but that doesn't cover it. When the user first comes tot he site page is nt defined.
Any help would be super appreciated.
Rob
current page test
Re: current page test
Try;
That will give the alias or id depending on what was in the url.
Code: Select all
global $gCms;
$thispage = $gCms->variables['page_name'];
Re: current page test
Almost worked...
tinkered and got it to work like this.
tinkered and got it to work like this.
Code: Select all
global $gCms;
$thispage = $gCms->variables['page_name'];
if( $thispage == "home" || $thispage == "1")
{
echo "<img src=\"uploads/images/intro.jpg\" border=\"0\" >";
}
Re: current page test
BTW
Wishy,
Thank you very much for being so proactive on this forum and helping us noobs out.
The project that I am working on now requires a webshop of sorts and I am going to write it module style. So hopefully in a few days here CMS MS gets an official shop module.
Thanks again.
Rob
Wishy,
Thank you very much for being so proactive on this forum and helping us noobs out.
The project that I am working on now requires a webshop of sorts and I am going to write it module style. So hopefully in a few days here CMS MS gets an official shop module.
Thanks again.
Rob
Re: current page test
No problem. I try to help where I can.
That's great. I'm very interested in seeing it.
That's great. I'm very interested in seeing it.