The quick and dirty way to do it.
To cut prefix:
<?php
$prefix = Mage::getStoreConfig('design/head/title_prefix');
$title = $this->getLayout()->getBlock('head')->getTitle();
$processedTitle = trim(substr($title, strlen($prefix)));
?>
<h1><?php echo $processedTitle;?></h1>
To cut suffix:
<?php
$suffix = Mage::getStoreConfig('design/head/title_suffix');
$title = $this->getLayout()->getBlock('head')->getTitle();
$processedTitle = substr($title, 0, strlen($suffix) * -1);
?>
<h1><?php echo $processedTitle;?></h1>
Joe78,
I put this:
<? var_dump(Mage::getSingleton('core/design_package')->getPackageName()); ?>
At the bottom of the footer.phtml file in magento/app/design/frontend/rwd/default/template/page/html
(before even running the installer) on a fresh unpack of 1.9.
As soon as I loaded the frontend up I found string 'rwd' (length=3)
in my site's footer.
I believe what package you have returned is going to depend on where exactly you put the package call. Also the following:
<? var_dump(Mage::getSingleton('core/design_package')->getTheme('frontend')); ?>
should in-fact return "default" on a vanilla 1.9 install as you're using magento/app/design/frontend/rwd/default as your theme.
For more info or to dive into how core/design_package is structured simply add the following to a template file:
<? var_dump(Mage::getSingleton('core/design_package')); ?>
The response you get should start out with something like:
object(Mage_Core_Model_Design_Package)[133]
protected '_store' => null
protected '_area' => string 'frontend' (length=8)
protected '_name' => string 'rwd' (length=3)
protected '_theme' =>
array (size=5)
'locale' => string 'default' (length=7)
'default' => null
'layout' => string 'default' (length=7)
'template' => string 'default' (length=7)
'skin' => string 'default' (length=7)
For a little more insight into how exactly design/package fallback works in 1.9 take a gander at the files in magento/app/code/core/Mage/Core/Model/Design
Hope this helps!
Best Answer
I found a solution with the identifier there is the easiest way to do it: