Tutorial

One of the things I like to change or edit on occasion, is the code related to the Dolphin 7 Main Logo. By default when you click on your Logo it takes you to the homepage. This is usually fine in most situations, but there are already multiple links to the homepage already. In some cases you may want to change the link someone is taken to when they click on your logo. For instance maybe you want it to take someone to your about us page instead. Or, you created a custom page in Dolphin that you want people taken to if they click on your logo. I will show you how to change the Main Logo link.

The other thing you will find if you view the source code is the alt associated with the logo image is logo. Notice the alt="logo" part of the highlighted code below. This is usually not a big issue, but some people like to optimize image alt's for SEO purposes. I will show you how to change this too.

The drawback to changing either of these is that it involves editing a core Dolphin php file. This will mean if you make changes to the file and Boonex happens to release a new version that contains this file you will need to reapply the changes.

At the time of this post the current version is: Dolphin 7.0.9

Before you make any changes, it is a good idea to download and backup the following file:
/inc/design.inc.php

Once you have downloaded the backup you can open /inc/design.inc.php in your hosting account with a file manager and editor, or a ftp client.

Search the file for: function getMainLogo

The line you are looking for is this:
return '<a href="' . BX_DOL_URL_ROOT . '"><img src="' . $site['mediaImages'] . $sFileName . '" class="mainLogo" alt="logo" /></a>';


You will find it within the function:
function getMainLogo() {
global $dir, $site;

$sFileName = getParam('sys_main_logo');
if(!file_exists($dir['mediaImages'] . $sFileName))
return '';

return '<a href="' . BX_DOL_URL_ROOT . '"><img src="' . $site['mediaImages'] . $sFileName . '" class="mainLogo" alt="logo" /></a>';
}



Changing the Logo Link:


Notice the BX_DOL_URL_Root in the code. You can change this to your desired page.

For example if I wanted the Logo to take someone to the about us page I would change it to:

return '<a href="' . BX_DOL_URL_ROOT . 'about_us.php"><img src="' . $site['mediaImages'] . $sFileName . '" class="mainLogo" alt="logo" /></a>';

Note:
Be sure to clear the template cache in your Dolphin Administration after making the changes just to make sure.



Changing the Logo Alt:


As you can see in the code the alt="logo". Simply change that to your desired alt and save the changes back to your hosting account like so:

return '<a href="' . BX_DOL_URL_ROOT . '"><img src="' . $site['mediaImages'] . $sFileName . '" class="mainLogo" alt="My Keword or phrase" /></a>';

Note:
Be sure to clear the template cache in your Dolphin Administration after making the changes just to make sure.



Add Title tag to your Dolphin 7 Logo:


The title tag is the text someone will see when they hover their mouse over the Logo image.

If you would like to add the title tag to your logo simply add title="My Image Title".

You can do so with the following:

return '<a title="My Image Title" href="' . BX_DOL_URL_ROOT . '"><img src="' . $site['mediaImages'] . $sFileName . '" class="mainLogo" alt="My Keword or phrase" /></a>';

Save the changes back to your hosting account.

Note:
Don't forget to clear the template cache after doing so.



Here is an example making changes to all 3. I have changed the link and alt, and added a title tag:

return '<a title="My Image Title" href="' . BX_DOL_URL_ROOT . 'about_us.php"><img src="' . $site['mediaImages'] . $sFileName . '" class="mainLogo" alt="My Keyword or phrase" /></a>';


Additional:
These are fairly simple changes to make. Remember to keep in mind that if design.inc.php happens to change in an update you would need to reapply the changes.



Screen shot examples:



This is the Dolphin Main Logo:

Dolphin Main Logo



Here is the default source code showing the alt="logo":

Main Logo Alt Image



Here I added the title="My Logo Title" tag:

Main Logo Title



 
Written By
Tutorial by: Jeremy LeSarge (AKA Ray)

I am the owner and administrator of DialMe.com. I write Tutorials for Boonex Dolphin as well as tips and resources surrounding website programming and development. I enjoy working with WordPress, SEO, and Web Hosting / Servers. I also maintain a WordPress Blog here on this site where you will find a variety of technology and webmaster resources.

Actions
Sponsored Links
Recommend