Is there any way that I can check if the currently rendered page is the Default page. For example inside a template something like {if default_page}. If not, how can I accomplish this, with a tag/plugin? I'm running 0.13-beta1.
TIA
Check if default page?
-
Raven
Re: Check if default page?
It would be a bit easier if you shared with us why you want this?
If you need this to display some extra functions etc. Please note that you can have your own seperate style/layout for your default page.
If you need this to display some extra functions etc. Please note that you can have your own seperate style/layout for your default page.
Last edited by Raven on Sat May 06, 2006 7:43 pm, edited 1 time in total.
-
hansom
Re: Check if default page?
Sorry for the lack of info, I had a Menu Manager template that I wanted to render slightly different on the default page. And I didn't want to have two separate templates. Here's what I did:
I eventually scrapped the idea and chose a different layout. But anyway, is there a better way to do this, if the need comes up again?
Code: Select all
{php}
global $gCms;
$this->assign('default_content_page', ($gCms->variables['content_id'] == ContentManager::GetDefaultPageID()));
{/php}Re: Check if default page?
Does you default page id change often? If not, then you can just do something like (assuming the default page is id 1): in your menu manager template.
Code: Select all
{if $node->id == 1}
//Do Stuff
{/if}-
hansom
Re: Check if default page?
Yeah I know. But since the default page probably will be changed someday I wanted a solution that just works without having to update the template. It's just the way I like things to work... 

