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
Override {sitename}
Re: Override {sitename}
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?
If all else fails, use a bigger hammer.
M@rtijn wrote: This is a community. This means that we work together and have the same goal (a beautiful CMS), not that we try to put people down and make their (voluntary) job as difficult as can be.
-
- Forum Members
- Posts: 57
- Joined: Sun Mar 25, 2007 7:42 am
Re: Override {sitename}
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
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
-
- Forum Members
- Posts: 57
- Joined: Sun Mar 25, 2007 7:42 am
Re: Override {sitename}
Hi;
Really appreciate if someone could help with this, I've exhausted all my ideas, google / forum searches etc.
Thanks
P
Really appreciate if someone could help with this, I've exhausted all my ideas, google / forum searches etc.
Thanks
P
-
- Support Guru
- Posts: 8169
- Joined: Tue Oct 19, 2004 6:44 pm
Re: Override {sitename}
CMSMS does not support 'multi-site'... in whatever variety you can think of it.I have a dynamic site that hosts pages for many different domains, the sitename gets pulled from a new database table.
CMS supports 1 install == 1 domain == unique directory.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
-
- Forum Members
- Posts: 57
- Joined: Sun Mar 25, 2007 7:42 am
Re: Override {sitename}
Hi;
Well, OK, but how do I overwrite {sitename} with a value programatically ??
Thanks
P
Well, OK, but how do I overwrite {sitename} with a value programatically ??
Thanks
P
Re: Override {sitename}
You'll have to modify the plugin. plugins/function.sitename.php.
Re: Override {sitename}
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
Nullig
-
- New Member
- Posts: 3
- Joined: Mon Jun 22, 2009 8:20 pm
Re: Override {sitename}
i use mle, so i made a new udt called sitename_lang:
and in the template i've changed {sitename} to {sitename_lang lang="$lang"}
Code: Select all
if($params['lang']=="nb_NO")
{
return("norwegian sitename");
}
else
{
return "english sitename";
}