[Solved] Where is the <title> generated?

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.
Locked
10010110

[Solved] Where is the <title> generated?

Post by 10010110 »

My client asked me to add the domain/site nme to the admin panel’s title, probably because it can get confusing if you have more sites with the CMS and it’s just showing “Pages” on the page listing page. I’ve searched and searched but I can’t find the place where the title element is generated/inserted.
I know it doesn’t work by changing the appropriate language array as there are more places where this item is displayed (e.g. the breadcrumb navigation) and I think it would be sufficient if I just hard code it into the source file. But which file is it? Where is the element generated?

Any help appreciated.
Last edited by 10010110 on Fri Jul 20, 2007 4:10 am, edited 1 time in total.
User avatar
Nullig
Power Poster
Power Poster
Posts: 2380
Joined: Fri Feb 02, 2007 4:31 pm

Re: Where is the <title> generated?

Post by Nullig »

I believe it's in the language file for admin located in the /admin/lang/en_US/admin.inc.php file.

Nullig
tingeltangeltill

Re: Where is the <title> generated?

Post by tingeltangeltill »

10010110 wrote: Where is the element generated?
If you look in the template, you see that:

Code: Select all

<title>{sitename} - {title}</title>
You just have to go to global settings and set in the sitename and then your customer should be satisfied ;-)

regards till
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: Where is the <title> generated?

Post by Dr.CSS »

I believe they were looking to change the title in the admin/backend, Nullig is right...
also if you use admin title in the search the second hit will tell you which lines to change...
10010110

Re: Where is the <title> generated?

Post by 10010110 »

Well, I’ve already suspected that it would be in the language file. However, as I said, when I chage that line:

Code: Select all

$lang['admin']['pages'] = 'Pages';
then the breadcrumb navigation below the menu will also be changed. And that’s not what I want. So I thought I might search for the place where the title element is generated to hard code it in there - independent of any language (since it’s the site URL there doesn’t need to be a translation).

And I’ve searched the forums before asking my question (I always try to find the solution myself before asking) but the results didn’t really help me (or I just didn’t understand), that’s why I’m asking.
User avatar
Nullig
Power Poster
Power Poster
Posts: 2380
Joined: Fri Feb 02, 2007 4:31 pm

Re: Where is the <title> generated?

Post by Nullig »

In the admin.inc.php file, look for these entries:

Code: Select all

$lang['admin']['adminsystemtitle'] = 'CMS Admin System';
$lang['admin']['adminpaneltitle'] = 'CMS Made Simple Admin Panel'; // needs translation
$lang['admin']['logintitle'] = 'CMS Made Simple Admin Login'; // needs translation

Nullig
10010110

Re: Where is the <title> generated?

Post by 10010110 »

You seem not to understand me correctly. I don’t want to change the headlines of the admin panel, I wanna change the title of the document (the stuff in between the tags), the text that is displayed at the top in the browser window.

Image

And to say it the third time: If I change the line in the admin.inc.php file that reads:

Code: Select all

$lang['admin']['pages'] = 'Pages';
…it does change the title but it’s also changing the text in the breadcrumb navigation (bottom left of atteched image).

And I can’t find the file where the actual element is generated… ???
10010110

Re: Where is the <title> generated?

Post by 10010110 »

So… nobody is able to tell me how I can change that without changing the breadcrumb navigation too? Any source developer here that knows a solution?
Please, that’s very important to me (or to my boss at least but I’m the one that has to answer the questions that keep on coming).  :-\
tsw
Power Poster
Power Poster
Posts: 1408
Joined: Tue Dec 13, 2005 10:50 pm

Re: Where is the <title> generated?

Post by tsw »

title is generated in admintheme class. (/var/classes/class.admintheme.inc.php) you could copy function DisplayHTMLHeader to default theme and modify it to your needs.

for example using something like

cms->siteprefs[sitename] ." - ". $this->title ?>

I also agree that its hard to navigate between multiple installations, maybe title should include sitename as default and the header in admin should also include sitename..

hope this helps..
10010110

Re: Where is the <title> generated?

Post by 10010110 »

Thank you, thank you very much! That did it! :D

Just to clarify (in case someone is also looking for that solution): The admintheme class file resides in “/lib/classes/” (not “var” directory).

Thanks again, tsw. You saved my life. :)
Locked

Return to “CMSMS Core”