No site title when editing settings

A place to report and discuss bugs - please mention CMSimple-version, server, platform and browser version
Post Reply
leenm
Posts: 116
Joined: Wed Dec 09, 2009 12:33 pm
Location: Kloetinge, Netherlands
Contact:

No site title when editing settings

Post by leenm » Wed Feb 10, 2010 6:37 pm

When you edit the config, no site title is shown. (CMSimple_XH v1.1)

The reason (adm.php line 153-161):

Code: Select all

if ($file == 'config'){
    foreach($tx['meta'] as $key => $param){
        if(isset($cf['meta'][$key])){unset($cf['meta'][$key]);}
    }
    foreach($tx['site'] as $key => $param){
        if(isset($cf['site'][$key])){unset($cf['site'][$key]);}
    }
    $a = 'cf';
} 
Solution:
adm.php, line 153-161:

Code: Select all

$unset_conf = array();
if ($file == 'config') {
    foreach($tx['meta'] as $key => $param) {
        if(isset($cf['meta'][$key])) {
            $unset_conf[] = 'meta'.$key;
        }
    }
    foreach($tx['site'] as $key => $param) {
        if(isset($cf['site'][$key])) {
            $unset_conf[] = 'site'.$key;
        }
    }
    $a = 'cf';
} 
 and line 216: 

Code: Select all

if(!is_array($v2) && !in_array($k1.$k2, $unset_conf)) { 
I'll add this solution to CMSimple_XH (unless you provide a good reason why not ;) ).

Leen

Gert
Posts: 3078
Joined: Fri May 30, 2008 4:53 pm
Location: Berlin
Contact:

Re: No site title when editing settings

Post by Gert » Wed Feb 10, 2010 7:01 pm

Do you mean the change-field in the configuration-view???

That we have removed from config-view, because the site-title you have to change in the language-file, so it is language-dependent. The $cf-variables they we have moved to language file as $tx-variables, should not be visible in the configuration-view. The $cf-variables are created by the system from the dependent $tx-variables (site_title, meta_keywords and meta_description).

If it is visible in the config-view and you change it, it will be overwrote by the language file, so it is effectless. That were confusing.

IT's NOT A BUG ;) , it have to be so.
Gert Ebersbach | CMSimple | Templates - Plugins - Services

leenm
Posts: 116
Joined: Wed Dec 09, 2009 12:33 pm
Location: Kloetinge, Netherlands
Contact:

Re: No site title when editing settings

Post by leenm » Wed Feb 10, 2010 7:19 pm

Gert wrote:If it is visible in the config-view and you change it, it will be overwrote by the language file, so it is effectless. That were confusing.
I understand this. Maybe my explanation wasn't good enough, sorry for that. :oops:
What I meant was that the function sitename() doesn't return the sitetitle when you edit the settings. My solution still hides the input field for site_title (and meta tags) when editing the settings, but shows the current site title (for ex. in the header of the site).

Leen

Gert
Posts: 3078
Joined: Fri May 30, 2008 4:53 pm
Location: Berlin
Contact:

Re: No site title when editing settings

Post by Gert » Wed Feb 10, 2010 7:26 pm

Hm, so I understood right at first, but then I have tested, and I can change the config-settings again and again, sitename() shows the site title in the header.

And the new function sitename() uses the tx-variable:

http://www.cmsimpleforum.com/viewtopic. ... t=10#p9988

Update: ah, my installation already have the new functions sitename() and pagename(), maybe that's why the function sitename() by me is working.
Gert Ebersbach | CMSimple | Templates - Plugins - Services

leenm
Posts: 116
Joined: Wed Dec 09, 2009 12:33 pm
Location: Kloetinge, Netherlands
Contact:

Re: No site title when editing settings

Post by leenm » Wed Feb 10, 2010 7:34 pm

Gert wrote:Update: ah, my installation already have the new functions sitename() and pagename(), maybe that's why the function sitename() by me is working.
Ah, ok. I wasn't working in the newest version where this was implemented. :oops: :oops:

Well, it's solved already then. :D

Leen

Gert
Posts: 3078
Joined: Fri May 30, 2008 4:53 pm
Location: Berlin
Contact:

Re: No site title when editing settings

Post by Gert » Wed Feb 10, 2010 7:38 pm

But maybe, that function pagename() now has that Bug, because that's the old function sitename().
Gert Ebersbach | CMSimple | Templates - Plugins - Services

Gert
Posts: 3078
Joined: Fri May 30, 2008 4:53 pm
Location: Berlin
Contact:

Re: No site title when editing settings

Post by Gert » Wed Feb 10, 2010 7:56 pm

Now I have tested with an older installation:

It's not a problem. If you save the config, the site title in the header is not shown, because the config is saved without the variables from the language file, but only temporarily.

By any action the $cf-variables are back, created by the dependent $tx-variables. You just have to change to another page or to view mode or so. No user should notice that.

But in the new version it is only important for the new function pagename(), the new function sitename() anyway uses the $tx-variable directly.
Gert Ebersbach | CMSimple | Templates - Plugins - Services

leenm
Posts: 116
Joined: Wed Dec 09, 2009 12:33 pm
Location: Kloetinge, Netherlands
Contact:

Re: No site title when editing settings

Post by leenm » Wed Feb 10, 2010 11:32 pm

Gert wrote:It's not a problem. If you save the config, the site title in the header is not shown, because the config is saved without the variables from the language file, but only temporarily.
I know it's temporarily, but there's no reason to hide it, is there? That's why we shouldn't hide the site title, don't make it more confusing than it already is :D .
Gert wrote:But in the new version it is only important for the new function pagename(), the new function sitename() anyway uses the $tx-variable directly.
Indeed.

Leen

Post Reply