Are Database Layout Updates still used in Magento?
Deep in the Magento Layout system, there's the following code that's used to turn your package layout xml files into the specific XML needed to create your Blocks, and therefore create your pages
public function merge($handle)
{
$packageUpdatesStatus = $this->fetchPackageLayoutUpdates($handle);
if (Mage::app()->isInstalled()) {
$this->fetchDbLayoutUpdates($handle);
}
}
The second method there fetchDbLayoutUpdates
tries to load additional XML Updates from the database with SQL queries something like this
SELECT `update`.`xml` FROM `core_layout_update` AS `update`
INNER JOIN `core_layout_link` AS `link`
ON link.layout_update_id=update.layout_update_id
WHERE (link.store_id IN (0, '1'))
AND (link.area='frontend')
AND (link.package='default')
AND (link.theme='default')
AND (update.handle = 'default')
ORDER BY `update`.`sort_order` ASC'
Both the core_layout_update
and core_layout_link
tables are empty in a default installation.
So, I've always assumed this is a legacy feature that predates my time with Magento. Does anyone know if this feature is used anywhere by
The Magento Core Codebase
Any well known/prominent Extensions
You!
开发者_开发百科
I can see why the feature's been left in place (legacy concerns and what not), but I'm curious if it's something that's been officially-ish abandoned, or if it's just vastly under utilized.
I have some entries for cms_index_index
that adds an enterprise_banner
block. So it is used by Enterprise edition at least.
core_layout_update is related with widget instance, it seem core_layout_update has row for every widget instance that added from CMS->Widgets
精彩评论