You are here

Easily View Magento Layout with Alan Storm's Layoutviewer

Alan Storm has a great module called Layoutviewer that is great for front-end developers.  It allows you to see the layout that Magento will use to render a page. This can be useful to debug what layout updates have been applied to a page.  One way or another, it usually ends up in most of my development sites.

Here is a nice little shell script you can copy-and-paste or download to easily add it to your project:

# If we are in the root, then we need to go into app/code/local.
if [ -f "index.php" ]; then
    cd app/code/local;
curl -so - $VIEWER_HTTP_DOWNLOAD | tar xvzf -
cat <<'ConfigFile'
<?xml version="1.0"?>
) > ../../etc/modules/Allanstormdotcom_Layoutviewer.xml

Also, here is a little bookmarklet that you can use to show the formatted XML for a page using the installed module:

Display Layout

Just drag it to your bookmarks bar!

You can also download the attached shell script. It will (from the htdocs folder for your Magento site) download the layoutviewer module.

Plain text icon install-lv.txt575 bytes