Welcome, Guest. Please login or register.
Did you miss your activation email?
May 24, 2012, 10:00:42 AM

Login with username, password and session length
Search:     Advanced search
Interested in joining the WebsiteBaker team?
For more Information read here or on our new website.
155445 Posts in 21703 Topics by 7731 Members
Latest Member: zvaigzdzius
* Home Help Search Login Register
Pages: [1]   Go Down
Print
Author Topic: how to exclude Web Site name from title tag  (Read 476 times)
MissyW

Offline Offline

Posts: 42


« on: October 29, 2008, 09:08:07 AM »

The web site name is included at the beginning of the title tag on every web page.  (In http://www.websitebaker2.org/forum/index.php/topic,8500.0.html, rebenwurzel says: "page_title includes both. Page name and Website name. ")

This must work well for a few web sites such as websitebaker.org where the domain name is all important.  But for most of us, this is not the case. I do not want the web site name emphasized to the search engines as the most important piece of information on every web page.

How can I get the title tag to include only the page title and not the website name?  huh  Is this possible without nulling the web site name?  Does anyone know how?  Thanks!
Logged
doc
Guest
« Reply #1 on: October 29, 2008, 12:13:35 PM »

Hello,

maybe the WB help project already has an answer:
http://help.websitebaker.org/pages/en/advanced-docu/designer-guide/adding-template-functions.php#anker1

Regards Christian
Logged
MissyW

Offline Offline

Posts: 42


« Reply #2 on: October 30, 2008, 12:21:02 AM »

Hello Christian


Brilliant!   Thank you.
I had to make my best guess at changing the code in framework/frontend.functions.php.   It was:
// Function for page title
if (!function_exists('page_title')) {
    function page_title($spacer = ' - ', $template = '[WEBSITE_TITLE][SPACER][PAGE_TITLE]') {
        $vars = array('[WEBSITE_TITLE]', '[PAGE_TITLE]', '[MENU_TITLE]', '[SPACER]');
        $values = array(WEBSITE_TITLE, PAGE_TITLE, MENU_TITLE, $spacer);
        echo str_replace($vars, $values, $template);
    }
}

I changed the $template = '[WEBSITE_TITLE][SPACER][PAGE_TITLE]' to:
$template = '[PAGE_TITLE]'

and it seemed to do the trick.   Thank you! cheesy

Regards Missy
« Last Edit: October 30, 2008, 12:43:24 AM by MissyW » Logged
doc
Guest
« Reply #3 on: October 30, 2008, 07:25:28 AM »

Hello,

there is no need to change the WB core files.

Just use
Code:
<?php page_title('''[PAGE_TITLE]'); ?>
in the index.php file of your template instead of
Code:
<?php page_title('''[WEBSITE_TITLE][SPACER][PAGE_TITLE]'); ?>

Regards Christian
Logged
MissyW

Offline Offline

Posts: 42


« Reply #4 on: October 30, 2008, 10:33:25 AM »

Hi Christian

Mmm...  I thought of that as I rushed out the door this morning.   That will teach me not to do these things in a rush, when with a little more thought I might have got it right the first time.   We live and learn.  Thanks for your patience.   Will give it a try in the morning.  (Its 7.30pm in Brisbane, Australia).

Cheers,
Missy
Logged
Pages: [1]   Go Up
Print
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!