Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Are Database Layout Updates still used in Magento?

Tags:

php

xml

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

  1. The Magento Core Codebase

  2. Any well known/prominent Extensions

  3. 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.

like image 687
Alan Storm Avatar asked Jan 07 '11 23:01

Alan Storm


People also ask

What is the correct way to inject CMS block in a layout?

A CMS block is injected into the layout by using the Magento/Cms/Block/Block class with the block_id argument. Any block or container can be used as a reference. As a result, the CMS block added to the bottom of the page.

Where are the base files of the page layout files located in the Magento directory?

The basic view of all Magento storefront pages is defined in two page configuration layout files located in the Magento_Theme module: <Magento_Theme_module_dir>/view/frontend/layout/default. xml : defines the page layout.


1 Answers

I have some entries for cms_index_index that adds an enterprise_banner block. So it is used by Enterprise edition at least.

like image 198
clockworkgeek Avatar answered Sep 19 '22 00:09

clockworkgeek