You are listing 2 ways to do layout updates. Let me start by giving the ways to update the layout in Magento 1 that I know. I think there are at least 6 ways to update layout XML:
- In a controller class
- In a layout XML file configured by a module
- In a
local.xml file in a theme
- In a Block class
- In a PHTML template (using the Block class)
- In the layout update of a CMS page
Most of the times you will be (should be) doing the first 3. I think you should configure the layout in XML files and if it needs to be manipulated depending on user input, you could do so in a controller.
I think you could also do stuff with layout in a Block class, there are some cases where this can be considered. I'd never manipulate layout in a PHTML file. If you end up doing that, move it to the Block class code.
Of course, a special case, you can set layout updates on CMS pages. I'd also advise you to only do this in special cases.
The reason one thing is considered good practice and the other not very good practice is traceability: The first place you will look to understand why something is happening is in the layout XML files. The last place you would think of to look is those CMS layout updates.
Now, the difference between layout updates through a module (XML file configured in
config.xml) and in a theme (theme's
local.xml) can sometimes be a bit of a gray area. I would state that:
- layout XML updates that are needed for your module to operate should be in your module
- layout XML updates that concern visual changes/enhancements needed for your theming, should be done in your theme
Module layout updates can be providing layout for layout handles specific for your module's controllers. Theming updates should therefore typically affect handles and blocks that are present in the Magento core.