Add sitename to all pages in the website?

Currently only the title of the page you are on shows up in the browser title bar when you view a page.

I want to have my site name in the titlebar  as well, how do i do this?

I do not see any admin options for this

Quote · 10 Feb 2012

Open /templates/base/_header.html and look for this line:

 

<title> __page_header__</title>

 

Change it to:

 

<title>Your site name  __page_header__</title>

 

Or any variation you would like.

BoonEx Certified Host: Zarconia.net - Fully Supported Shared and Dedicated for Dolphin
Quote · 10 Feb 2012

thank you

Quote · 10 Feb 2012

Hmm...only problem is the home page...

<title>Your site name  __page_header__</title>

Then my homepage will display: "My Site Name - My Site Name".

On other pages, it works nicely: "My Site Name - Page Name".

Any solution for just the homepage?

Thanks!

Quote · 2 Mar 2012

go inside php :)

so much to do....
Quote · 2 Mar 2012

hi Prashank, which php file to edit?

Quote · 3 Mar 2012

ermm, must I use a if statement?

If homepage then <title>__page_header__</title>

else

<title>Your site name  __page_header__</title>

?

Quote · 7 Mar 2012

hello, sorry for late reply but i am very busy these days. so i post here very rarely now.

here is your solution i guess. try it.

open \inc\classes\BxDolTemplate.php on line 700

you will find

case 'page_header':

                if(!empty($GLOBALS[$this->_sPrefix . 'PageTitle']))

                    $sRet = $GLOBALS[$this->_sPrefix . 'PageTitle'];

                else if(isset($_page['header']))

                    $sRet = $_page['header'];

change it to

case 'page_header':

                if(!empty($GLOBALS[$this->_sPrefix . 'PageTitle']))

                    $sRet = $GLOBALS[$this->_sPrefix . 'PageTitle'];

                else if(isset($_page['header']))

                    $sRet = $_page['header']." | My site";

and obviously replace My site with your site.

I think it will go to my tutorial site. soon...:)

Good luck

so much to do....
Quote · 7 Mar 2012

Thanks Prashank!! 

That worked!

For those for would like to follow:

1) Do not modify the templates/base/_header.html

2)

open \inc\classes\BxDolTemplate.php on line 700

you will find

case 'page_header':

                if(!empty($GLOBALS[$this->_sPrefix . 'PageTitle']))

                    $sRet = $GLOBALS[$this->_sPrefix . 'PageTitle'];

                else if(isset($_page['header']))

                    $sRet = $_page['header'];

change it to

case 'page_header':

                if(!empty($GLOBALS[$this->_sPrefix . 'PageTitle']))

                    $sRet = $GLOBALS[$this->_sPrefix . 'PageTitle'];

                else if(isset($_page['header']))

                    $sRet = $_page['header']." | My site name";

E.g. Search page title will be : "Search | My site name"

I've edited mine to be: "My site name - ".$sRet = $_page['header'];

So e.g. Search page title will be : "My site name - Search"

Quote · 7 Mar 2012

You're welcome Smile

so much to do....
Quote · 7 Mar 2012

Thank you for this. Its very helpful.

Quote · 19 Apr 2012

Very good tip, except I'd put

$GLOBALS['site']['title']

instead of "Site Name".

 

just in case you change the name in the future.  Or copy the code to  make another site.  You might forget this and spend a LONG time hunting this little gem down.  lol!

http://www.mytikibar.com
Quote · 19 Apr 2012

 thanks for making it better

Very good tip, except I'd put

$GLOBALS['site']['title']

instead of "Site Name".

 

just in case you change the name in the future.  Or copy the code to  make another site.  You might forget this and spend a LONG time hunting this little gem down.  lol!

 

so much to do....
Quote · 19 Apr 2012
 
 
Below is the legacy version of the Boonex site, maintained for Dolphin.Pro 7.x support.
The new Dolphin solution is powered by UNA Community Management System.