Page 1 of 1

Using URL ?page=???? in if then statement

Posted: Fri Jan 27, 2006 4:25 pm
by Jessica
Hi All,

First off I want to say hi and how much I am totally loving CMSMS!!!! This thing really rocks and I can't wait to use it for my clients.

Now on to my question: I am trying to hide the {title} on the home page

{if $page = "Home"}
                      nothing
               {else}
                     {title}
          {/if}


Now I notice that CMS caches the variable "Home" - (I found this out by using {$smarty.get.page} ) -
How do I get around this??

Thanks for your help in advance - and again - I LOVE CMSMS!!!!

Best Regards,
Jessica


"Nothing in this world can take the place of persistence.
Talent will not; nothing is more common than unsuccessful people with talent.
Genius will not; unrewarded genius is almost a proverb. Education will not;
The world is full of educated derelicts. Persistence and determination alone are omnipotent.
The slogan 'press on' has solved and always will solve the problems of the human race." -- Calvin Coolidge

Re: Using URL ?page=???? in if then statement

Posted: Fri Jan 27, 2006 8:18 pm
by lemkepf
The way i did it was make a completely different template for the homepage. So my homepage doesn't display the breacrumbs and makes other things look different. Then on every other page i use a different template that includes that stuff.

That's the easiest way i found. :)

Re: Using URL ?page=???? in if then statement

Posted: Sat Jan 28, 2006 6:45 pm
by jbogard
Thanks I didn't think about that duh!! I just downloaded this thing and I am having a blast with it, it is so easy to use!!

Thanks Again

Jessica

Re: Using URL ?page=???? in if then statement

Posted: Mon Jan 30, 2006 12:16 am
by geraud
Hi,

I have the same problem but I don't want to use a different template for each page (lot of work if you want to change the template of your site).

Is there another solution ?

Cheers
Geraud

Re: Using URL ?page=???? in if then statement

Posted: Wed Feb 08, 2006 10:22 pm
by amygdela
you shouldn't use $page, but $_get['page'] there's a very big chance your registerglobals are on.

Re: Using URL ?page=???? in if then statement

Posted: Fri Feb 10, 2006 3:13 am
by thetallguy
geraud wrote: I have the same problem but I don't want to use a different template for each page (lot of work if you want to change the template of your site).
For my site, I wanted several different types of pages, which meant different templates, but have a lot of the same stuff appearing on each.  My solution was to make HTML Blob modules for each kind of thing on the page. For example, there's a blob for everything in the , another for the page header, and another for the page title block (which in this design is not the same as the header). Content area, footer, sidebar, etc.

With all these blobs, I could then easily drop them into different templates.  The templates roughly 12 lines long, each using slightly different combinations of Blobs.  Change a Blob, and all the page designs change.

Michael

Re: Using URL ?page=???? in if then statement

Posted: Wed Apr 19, 2006 7:57 am
by xviper
Here is my solution to a similar problem:
I created an extra tag (a function.pageshow.php in the plugins folder for example) and used the following function:

function smarty_cms_function_pageshow($params, &$smarty) {
global $argv;
$query_string = $_SERVER['argv'][0];

$pg = strstr($query_string, "page=");

return $pg;
}

This should return "page=????" if there are no trailing variables. One can play a bit with the string parsing and get the desired result. The function can be then easy used for templates with {pageshow}.

Re: Using URL ?page=???? in if then statement

Posted: Mon Apr 24, 2006 4:03 pm
by Chuky
thetallguy wrote:
geraud wrote: I have the same problem but I don't want to use a different template for each page (lot of work if you want to change the template of your site).
For my site, I wanted several different types of pages, which meant different templates, but have a lot of the same stuff appearing on each.  My solution was to make HTML Blob modules for each kind of thing on the page. For example, there's a blob for everything in the , another for the page header, and another for the page title block (which in this design is not the same as the header). Content area, footer, sidebar, etc.

With all these blobs, I could then easily drop them into different templates.  The templates roughly 12 lines long, each using slightly different combinations of Blobs.  Change a Blob, and all the page designs change.

Michael
The html blob and global content blob looks attractive option but am wondering if it wont in anyway going to affect the loading speed of the site? Am a new person to both cmsmadesimple and programing but i am having a feeling using only blobs may affect the speed of the site. Someone correct me and set me straight pleas.