You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On Modx 2.3.1-pl, I can't override "site_name" setting simply by setting "site_name" key on client config.
Is there something I'm doing wrong ?
[Edit] It seems that it does not override it, only in the manager, for example, on the dashboard. If I use the setting in my client view, it works fine.
The manager dashboard loads the site name in a different way compared to using [[++site_name]] in the front-end... not sure if that is something we can override cleanly from a plugin..
I tried to deal with this too with no luck, but I've found an easy way to completely change the setting you wish to. Let's assume you have option called "site_name" in ClientConfig. Rename it to something like "website_name". Now you just have to add the following code inside your ClientConfig plugin:
...
$newname = $settings['website_name']; // this will work only within ClientConfig's plugin
$sitename = $modx->getObject('modSystemSetting', 'site_name');
$sitename->set('value', $newname);
$sitename->save();
...
break;
Now every time when you change "website_name" inside ClientConfig, the real "site_name" setting will be updated as well. Of course this's not a fix, but just a workaround. It works well in my case (I tried to alter "emailsender" setting from within ClientConfig).
In 1.4 with the change per #109/#115, overriding the site_name also works. I didn't try overriding the emailsender, but I suppose that'll work now too.
Activity
Mark-H commentedon Oct 7, 2014
The manager dashboard loads the site name in a different way compared to using
[[++site_name]]in the front-end... not sure if that is something we can override cleanly from a plugin..vallev commentedon Aug 7, 2016
I tried to deal with this too with no luck, but I've found an easy way to completely change the setting you wish to. Let's assume you have option called "site_name" in ClientConfig. Rename it to something like "website_name". Now you just have to add the following code inside your ClientConfig plugin:
Now every time when you change "website_name" inside ClientConfig, the real "site_name" setting will be updated as well. Of course this's not a fix, but just a workaround. It works well in my case (I tried to alter "emailsender" setting from within ClientConfig).
Mark-H commentedon Jan 31, 2017
In 1.4 with the change per #109/#115, overriding the site_name also works. I didn't try overriding the emailsender, but I suppose that'll work now too.