You can't do that. Specifically, you can't use the <update/>
tag in a CMS page's Layout Update XML field.
Magento processes the <update/>
nodes when it is initially loading the layout update files, and layout updates from the core_layout_update
table. This is done with the fetchRecursiveUpdates
function.
#File: app/code/core/Mage/Core/Model/Layout/Update.php
public function fetchPackageLayoutUpdates($handle)
{
//...
$this->fetchRecursiveUpdates($updateXml);
//...
return true;
}
public function fetchDbLayoutUpdates($handle)
{
//...
$this->fetchRecursiveUpdates($updateXml);
//...
}
//...
public function fetchRecursiveUpdates($updateXml)
{
foreach ($updateXml->children() as $child) {
if (strtolower($child->getName())=='update' && isset($child['handle'])) {
$this->merge((string)$child['handle']);
// Adding merged layout handle to the list of applied hanles
$this->addHandle((string)$child['handle']);
}
}
return $this;
}
A CMS page, however, is rendered later on via a helper method. The rendering of a CMS page includes this code
#File: app/code/core/Mage/Cms/Helper/Page.php
$action->loadLayoutUpdates();
$layoutUpdate = ($page->getCustomLayoutUpdateXml() && $inRange)
? $page->getCustomLayoutUpdateXml() : $page->getLayoutUpdateXml();
$action->getLayout()->getUpdate()->addUpdate($layoutUpdate);
$action->generateLayoutXml()->generateLayoutBlocks();
The loadLayoutUpdates
call is the standard loading of the layout, including the fetchRecursiveUpdates
mentioned above.
Then, Magento looks for a custom layout XML update set on the CMS page object
$layoutUpdate = ($page->getCustomLayoutUpdateXml() && $inRange)
? $page->getCustomLayoutUpdateXml() : $page->getLayoutUpdateXml();
and adds it directly to the list of updates to apply
$action->getLayout()->getUpdate()->addUpdate($layoutUpdate);
This means the scanning for the update
tag is never done.
If I was trying to implement something like this, I'd add a new block in the CMS page's layout update XML, and then add the shared layout items programmatically in the blocks _prepareLayout
method. (not sure off the top of my head if that would work w/r/t to timing, but that'd be where I'd start)
Magento offers the possibility to use templates from one theme and layouts from an other one.
Even if this sounds nice, I don't think anyone uses it (I ma be wrong) because it can confuse the developers.
To avoid this, make sure that in System->Configuration->Design->Themes
you set the same value for the fields Templates
and Layout
, the name of your theme.
If one of these is left blank the resources from the default theme will be used. (Theme1).
Best Answer
Yes of course, bu not page title, you can move content heading. In that case local.xml cannot affect to cms page, because of it is loaded before cms.xml. You should edit cms.xml as following:
You should change layout of cms page via admin.