开发者

Are Database Layout Updates still used in Magento?

开发者 https://www.devze.com 2023-02-02 22:24 出处:网络
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

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

  1. The Magento Core Codebase

  2. Any well known/prominent Extensions

  3. You!

  4. 开发者_开发百科

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

0

精彩评论

暂无评论...
验证码 换一张
取 消