2

For some reason, I'm not able to change the name of this site. I try to change the name to 'Test Name', as shown in this screenprint:

Screenshot of site information page

But after I save the page, the name is repopulated with the previous title.

It is an old drupal site with many years of modules and various admins working on it, so anything's possible. It does have Pathauto installed, but I can't see any place where that is overriding the site title.

Any thoughts?

1
  • Have you checked the templates to see if someone hardcoded it in?
    – rrr45
    Commented Aug 3, 2015 at 19:59

3 Answers 3

2

Look in settings.php; I expect someone set $conf['site_name'] = 'Test name'. Anything hard-coded there cannot be overridden.

2
  • Good guess, but we're not setting 'site_name' there..
    – doub1ejack
    Commented Aug 4, 2015 at 17:28
  • Do you have drush installed? If so, run: drush vset site_name "my new site name" Then run: drush vget site_name It should return "my new site name". If it doesn't, then you've got code somewhere overriding the global $conf['site_name'] value.
    – Aaron
    Commented Aug 4, 2015 at 17:36
2

I suspect that the title is hard coded somewhere in your template or module files. I recommend running the grep command in the command line to find which file(s) have the title hard coded.

grep -r "My Title" sites/default
1
  • Also a good guess. The title has been hardcoded for a few content types, but none of them are what I'm looking for..
    – doub1ejack
    Commented Aug 4, 2015 at 17:29
0

According to drupal documentation You can set it in settings.php with $conf['site_name'] = 'Test name'.

Also in drupal , site name registered with variables so you can get or set it with variable API

for set it use

  variable_set('site_name', 'My New site name');

This link can help you if you could'nt set it in your settings.php.

6
  • 2
    This is insufficiently persistent. Settings.php, as reference by Aaron, will update this variable's value on bootstrap.
    – Screenack
    Commented Aug 4, 2015 at 16:46
  • @Screenack in settings.php make it run every time but if he just want just one time set it , he can set it with this method.
    – Yuseferi
    Commented Aug 4, 2015 at 16:50
  • 2
    If I understand the original post, s/he's unclear why the title isn't updating based on changing the site settings page. Setting the variable will only be temporary, or as albertski suggests, mooted by logic or hard-wired code in template.php or template files.
    – Screenack
    Commented Aug 4, 2015 at 16:55
  • @Screenack I don't have discuss in this topic, it can cause several reason,I just suggest one solution to changing site_name ( before Pierre update the question, it was how change the site name of the site ) !!!!
    – Yuseferi
    Commented Aug 4, 2015 at 16:58
  • I don't mean to pick on you — the discussion might help the next person who comes along.
    – Screenack
    Commented Aug 4, 2015 at 17:00

Not the answer you're looking for? Browse other questions tagged or ask your own question.