Page 1 of 1

Override {sitename}

Posted: Wed Jun 17, 2009 11:50 am
by crankshaft
Hi;

I need to override the {sitename} dynamically, but none of the following seems to work:

global $gCms;
$smarty = &$gCms->GetSmarty();

$smarty->assign('sitename','xxxx');
$gCms->config['sitename'] = 'xxxxx';

Could someone let me know what I'm doing wrong ??

Thanks

P

Re: Override {sitename}

Posted: Wed Jun 17, 2009 2:55 pm
by tyman00
May I ask why you want to overwrite it? Can't you either make a new variable or just change the sitename parameter in your admin?

Re: Override {sitename}

Posted: Wed Jun 17, 2009 10:48 pm
by crankshaft
Hi;

I have a dynamic site that hosts pages for many different domains, the sitename gets pulled from a new database table.

I already have a new variable called {$pg_title} which is pulled from this table, I have tried setting the value of {sitename} with {$pg_title} but it has no effect as per previous thread.

If I create a new variable, then I will need to modify all of the templates, and I am trying to keep it so that I can use different templates without modifying them.

If I was able to use a variable in the GlobalSettings > Site Name then that would be a better solution, but I have also tried that and Global Settings only appears to accept text, not a variable name.

So entering {$pg_title} in the Global Serttings > Sitename results in a Site called '{$pg_title}' and not the value of $pg_title !

Thanks

P

Re: Override {sitename}

Posted: Fri Jun 19, 2009 12:42 am
by crankshaft
Hi;

Really appreciate if someone could help with this, I've exhausted all my ideas, google / forum searches etc.

Thanks

P

Re: Override {sitename}

Posted: Fri Jun 19, 2009 3:12 am
by calguy1000
I have a dynamic site that hosts pages for many different domains, the sitename gets pulled from a new database table.
CMSMS does not support 'multi-site'... in whatever variety you can think of it.
CMS supports 1 install == 1 domain == unique directory.

Re: Override {sitename}

Posted: Fri Jun 19, 2009 10:40 am
by crankshaft
Hi;

Well, OK, but how do I overwrite {sitename} with a value programatically ??

Thanks

P

Re: Override {sitename}

Posted: Fri Jun 19, 2009 10:47 am
by Ted
You'll have to modify the plugin.  plugins/function.sitename.php.

Re: Override {sitename}

Posted: Fri Jun 19, 2009 2:09 pm
by Nullig
Can you not just create a UDT called pg_title, which returns $pg_title, and then use {pg_title} in place of {sitename} in your templates?

Nullig

Re: Override {sitename}

Posted: Mon Jun 22, 2009 8:26 pm
by toillbaill
i use mle, so i made a new udt called sitename_lang:

Code: Select all

if($params['lang']=="nb_NO")
{
return("norwegian sitename");
}
else
{
return "english sitename";
}
and in the template i've changed {sitename} to {sitename_lang lang="$lang"}