3

So I know that in the theme.xml files in Community 1.9 or Enterprise 1.14 you can specify the theme fallback but while upgrading a customer from Enterprise 1.13 to 1.14 I noticed that there are also layout updates in this file. These only appear in the rwd theme file in the enterprise version. What are these for? I guess they are to update the files for certain modules layout and if so in this case what advantages to they have?

Example file: app/design/frontend/rwd/enterprise/etc/theme.xml

<theme>
    <parent>rwd/default</parent>
    <layout>
        <updates>
            <enterprise_catalogsearch>
                <file>enterprise/catalogsearch.xml</file>
            </enterprise_catalogsearch>
            <enterprise_checkout>
                <file>enterprise/checkout.xml</file>
            </enterprise_checkout>
            <enterprise_cms>
                <file>enterprise/cms.xml</file>
            </enterprise_cms>
            <enterprise_customer>
                <file>enterprise/customer.xml</file>
            </enterprise_customer>
            <enterprise_newsletter>
                <file>enterprise/newsletter.xml</file>
            </enterprise_newsletter>
            <enterprise_oauth>
                <file>enterprise/oauth.xml</file>
            </enterprise_oauth>
            <enterprise_page>
                <file>enterprise/page.xml</file>
            </enterprise_page>
            <enterprise_review>
                <file>enterprise/review.xml</file>
            </enterprise_review>
        </updates>
    </layout>
</theme>

So on the official Magento article about the rwd theme I have found the following snippet. It appears that this allows you to simply update some layout items to add the enterprise features rather than have complete copies with extra items added. I still do not full understand what is going on here.

Using the New Theme/Layout Structure—Magento EE only

If you've worked with a previous version of Magento EE, you're aware that the enterprise/default theme contains copies of many of the layout and template files from base/default—some with very minor changes. This is not an optimal approach because as it results in duplicated content.

The Magento EE responsive theme's rwd/enterprise directory includes only template and layout files that contain Magento EE-only features.

Instead of copying layout files as the enterprise/default theme does, rwd/enterprise isolates changes in their own layout files in [your Magento install dir]app/design/frontend/rwd/enterprise/layout/enterprise

The rwd/enterprise theme replaces the enterprise/default theme and contains far fewer files than its predecessor (156 compared to 280). This new approach makes it easier for you to see what functionality is unique to Magento EE.

4

So I now think I understand what is going on here, maybe.

In previous versions of enterprise the layout.xml files in the enterprise theme were simply copies of the base theme's files with the extra enterprise features added. So they have simply taken the base files and added a few lines to them and then included them all in the enterprise theme. This includes layout files with no changes from the base theme.

Now with the addition of theme fallback in version 1.14 the layout files in the enterprise rwd theme are simply the extra enterprise parts. Think of it as how you would change a theme via a local.xml or a module's layout file. This means that only the changes are in the layout files and not the complete copy with a few extra line.

This seems a massive benefit as you only have the changes you make for enterprise and not a complete copy.

For example in the catalog search for enterprise you have suggestions and recommendation blocks. In none rwd theme there is a complete enterprise/catalogsearch.xml file that is the same as the normal catalogsearch.xml file but with the two new blocks.

<catalogsearch_result_index translate="label">
    <label>Quick Search Form</label>
    <reference name="root">
        <action method="setTemplate"><template>page/3columns.phtml</template></action>
    </reference>
    <reference name="left">
        <block type="catalogsearch/layer" name="catalogsearch.leftnav" before="-" template="catalog/layer/view.phtml"/>
    </reference>
    <reference name="content">
        <block type="catalogsearch/result" name="search.result" template="catalogsearch/result.phtml">
            <block type="catalog/product_list" name="search_result_list" template="catalog/product/list.phtml">
                <block type="catalog/product_list_toolbar" name="product_list_toolbar" template="catalog/product/list/toolbar.phtml">
                    <block type="page/html_pager" name="product_list_toolbar_pager"/>
                </block>
                <block type="core/text_list" name="additional" translate="label">
                    <label>Additional Info</label>
                    <block type='enterprise_search/suggestions' name='search_suggestions' template="search/suggestions.phtml"></block>
                    <block type='enterprise_search/recommendations' name='search_recommendations' template="search/recommendations.phtml"></block>
                </block>
                <action method="addColumnCountLayoutDepend"><layout>empty</layout><count>6</count></action>
                <action method="addColumnCountLayoutDepend"><layout>one_column</layout><count>5</count></action>
                <action method="addColumnCountLayoutDepend"><layout>two_columns_left</layout><count>4</count></action>
                <action method="addColumnCountLayoutDepend"><layout>two_columns_right</layout><count>4</count></action>
                <action method="addColumnCountLayoutDepend"><layout>three_columns</layout><count>3</count></action>
                <action method="setToolbarBlockName"><name>product_list_toolbar</name></action>
                <action method="setPageLayout"><layout>three_columns</layout></action>
            </block>
            <action method="setListOrders"/>
            <action method="setListModes"/>
            <action method="setListCollection"/>
        </block>            
    </reference>
</catalogsearch_result_index>

Now the rwd enterprise/catalogsearch.xml file looks like a "normal" theme local.xml file and is simply the two new blocks being added to the handle by reference.

<layout version="0.1.0">

    <catalogsearch_result_index translate="label">
        <reference name="search_result_list">
            <block type="core/text_list" name="additional" translate="label">
                <label>Additional Info</label>
                <block type='enterprise_search/suggestions' name='search_suggestions' template="search/suggestions.phtml"></block>
                <block type='enterprise_search/recommendations' name='search_recommendations' template="search/recommendations.phtml"></block>
            </block>
        </reference>
    </catalogsearch_result_index>

</layout>

On a further note from @ErikHansen

You may also notice that with CE 1.9/EE 1.14, there were a number of core/text_list blocks that were added to the app/design/frontend/rwd/default/layout files to allow the Enterprise layout files to add functionality with overriding the entire layout files

  • I was just starting to write an answer to this question, but I see that you've answered your own question. You may also notice that with CE 1.9/EE 1.14, there were a number of core/text_list blocks that were added to the app/design/frontend/rwd/default/layout files to allow the Enterprise layout files to add functionality with overriding the entire layout files. – Erik Hansen Sep 29 '14 at 15:57
  • @ErikHansen thanks for the info. It really is a good improvement with this process. I like it. – David Manners Sep 29 '14 at 16:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.