1

Here's the objective: Have the site name at the end of page titles using System > Configuration > Design > HTML Head > Title Suffix “- mysitename.com”.

Saving works fine. Changes are live and all is working as it should. Code looks like:

<title>Best products that I have are now in the house. - mysitename.com</title>

Here's the problem: The “Flush Magento Cache” button when selected removes the preferred page titles and the site name becomes the Title Prefix. Code looks like:

<title>mysitename.com: Best products that I have are now in the house.</title>

Thoughts?

1 Answer 1

1

This block method creates the title concatenation is called setTitle:

#file: app/code/core/Mage/Page/Block/Html/Head.php
public function setTitle($title)
{
    $this->_data['title'] = Mage::getStoreConfig('design/head/title_prefix') . ' ' . $title
        . ' ' . Mage::getStoreConfig('design/head/title_suffix');
    return $this;
}

As you can see it's concatenating the title with the store config prefix and suffix, as expected.

After a cache clear you suggest the positions swap. This is not possible out of the box and suggests an issue with your store configuration. The title is a store view configuration setting - so it stands to reason that another store view has this setting swapped and what you see is the result of the uncached store view showing the value in the prefix.

To rectify, you'll have to locate all of the prefix and suffix values. A db query to grab them would like:

SELECT * FROM core_config_data
WHERE (path='design/head/title_suffix' OR path='design/head/title_prefix')

This should list all prefixes and suffixes. Check to make sure no store view has a prefix configured.

In addition you may have an issue with block cache that was undiscovered until now wherein other store view blocks are being displayed. I would follow the standard debugging process found here to try to nail down where this may be happening.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.