Override {sitename}

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Post Reply
crankshaft
Forum Members
Forum Members
Posts: 57
Joined: Sun Mar 25, 2007 7:42 am

Override {sitename}

Post 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
tyman00
Power Poster
Power Poster
Posts: 906
Joined: Tue Oct 24, 2006 5:59 pm

Re: Override {sitename}

Post 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?
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.
crankshaft
Forum Members
Forum Members
Posts: 57
Joined: Sun Mar 25, 2007 7:42 am

Re: Override {sitename}

Post 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
crankshaft
Forum Members
Forum Members
Posts: 57
Joined: Sun Mar 25, 2007 7:42 am

Re: Override {sitename}

Post by crankshaft »

Hi;

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

Thanks

P
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm

Re: Override {sitename}

Post 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.
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.
crankshaft
Forum Members
Forum Members
Posts: 57
Joined: Sun Mar 25, 2007 7:42 am

Re: Override {sitename}

Post by crankshaft »

Hi;

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

Thanks

P
Ted
Power Poster
Power Poster
Posts: 3329
Joined: Fri Jun 11, 2004 6:58 pm

Re: Override {sitename}

Post by Ted »

You'll have to modify the plugin.  plugins/function.sitename.php.
User avatar
Nullig
Power Poster
Power Poster
Posts: 2380
Joined: Fri Feb 02, 2007 4:31 pm

Re: Override {sitename}

Post 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
toillbaill
New Member
New Member
Posts: 3
Joined: Mon Jun 22, 2009 8:20 pm

Re: Override {sitename}

Post 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"}
Post Reply

Return to “CMSMS Core”