Mysidia Adoptables Support Forum  

Home Community Mys-Script Creative Off-Topic
Go Back   Mysidia Adoptables Support Forum > Mysidia Adoptables > Tutorials and Tips

Notices

Reply
 
Thread Tools Display Modes
  #1  
Old 01-20-2017, 09:50 PM
Dinocanid's Avatar
Dinocanid Dinocanid is offline
Member
 
Join Date: Aug 2016
Location: Maryland, USA
Posts: 516
Gender: Unknown/Other
Credits: 63,648
Dinocanid is on a distinguished road
Default Custom browser tab names

It was bothering me for the longest time how the tab name in your browser was always the name of your site, no matter what page you're on. Imagine members opening multiple tabs for different pages on your site and they can't tell which is which! I went ahead and fixed that.

-Step 1-
Go to public_html/templates/(Whatever theme you're using)/header.tpl. See the lines that look like this?:
Code:
<title>{$browser_title}</title>
Delete them. In case you have two of these lines, delete them both. If you feel uncomfortable about deleting them (maybe you want it for later?), just comment them out like this:
Code:
<! --<title>{$browser_title}</title> -->
-Step 2-
Now you can rename the tabs! For example, let's rename the tab of the inventory page. Go to inventoryview.php, find these lines:
PHP Code:
public function index(){
        
$mysidia Registry::get("mysidia");
        
$document $this->document;
        
$document->setTitle($mysidia->lang->inventory); 
And change it to this:
PHP Code:
public function index(){
        
$mysidia Registry::get("mysidia");
        
$document $this->document;
$document->add(new Comment("<title>Inventory</title>"));
        
$document->setTitle($mysidia->lang->inventory); 
-End-
You're done! The downside is that you'll have to do this for all of your pages, or else the tab name will just be the full URL. This works for pages made in the adminCP too! Just go to edit your custom page and add this before the rest of your content:
Code:
<title>Tab Title</title>
-Why edit the code?-
I found that if you attempt to use the html title tags without editing the header.tpl, then they won't work because they're being overridden. It is also important to note that this doesn't conflict with:
Quote:
$document->setTitle("Title");
Because that is for the title on the actual page itself, not the browser tab.
__________________

Last edited by Dinocanid; 01-20-2017 at 10:01 PM.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 01:47 PM.

Currently Active Users: 431 (0 members and 431 guests)
Threads: 4,080, Posts: 32,024, Members: 2,016
Welcome to our newest members, jolob.
BETA





What's New?

What's Hot?

What's Popular?


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
vBCommerce I v2.0.0 Gold ©2010, PixelFX Studios
vBCredits I v2.0.0 Gold ©2010, PixelFX Studios
Emoticons by darkmoon3636