How to Uniquely Determine the layout of a page

I've been building a module in which I need to know if a page has a unique layout.

My first thought was to get the list of layout handles and hash them. This works well for the most part, but doesn't take into account database layout updates.

My second thought was to hash the entire layout updates and use that. In principle, this works, but I think perhaps I am using the wrong function:


This seems to get the same thing on every request. How do I just get the updates applied on a specific request? Is there a convenient function for that?

Or, is there a way to just get db updates? Something like

md5(implode($update->getHandles()) . $update->getAllDbLayoutUpdates());

would also be swell.

Looking at it from a different angle, is there such a method created already? Have I been looking at it all wrong?


Not sure if this is what you need, but It seams I get a correct result with Mage::app()->getLayout()->getXmlString().
I tried for homepage and it even shows the value I add in the Layout Update XML field of the page.
I tried for a few other pages and it seams to get me the correct xml.
I also added a widget instance somewhere on the left column and it appears in the result.
So it works with the db layout updates.

Similar questions

how do I determine what cache tag is used for a block?
I have a block that uses addLink to create a checkout link in the header, to get the URL it uses a custom function $helper->getCheckoutUrl() ($helper being a utility helper created by someone else) which does a condition check to return what URL we need for the checkout link, the conditions are to determine if Precheckout is avaliable we use the...
magento order API determine if product belongs to a bundle
I am extracting new orders in Magento using API. I would like to know how I can tell if this is a simple product, bundle or component of a bundle. To get details I use soapObject method for when I dump details, it looks like this:
Determine if customer is new in customer_save_after
I have events that I wish to execute when a customer registers or saves their details. For this, I am using two events: customer_register_success and customer_save_after. The problem I am having is that I end up running the task twice as customer_save_after is always called in the same execution as customer_register_success. I have tried to detect ...
Exception Error: Could not determine temp directory, please specify a cache_dir manually
Tried to install magento 1.8.1 to my hosting server. Everything look fine in the frontend, and I can login to backend and add category. However when I try to modify it(e.g: Catalog>Manage Products)in the backend its getting exception printing is disabled by default for security reasons. Did I make anything wrong during the installation? Don't know ...
How do I determine if a widget is being used?
I'm cleaning up an extension which appears to effectively do nothing; the one remaining component to be removed is a widget, but I'm unsure how I would determine if the widget is used. What tactic would I need to follow to confirm whether or not the widget is in use in the system?
Determine MySQL Database used by Magento Installation
This question is probably fairly stupid but I installed a couple instances of Magento (for various reasons) and I made the MySQL database names very similar. In fact they only vary by some arbitrary numbering system I made up (and have since forgotten). All the installations have very few accounts, items, etc that were setup. I'm wanting to do some...

Also ask

We use cookies to deliver the best possible experience on our website. By continuing to use this site, accepting or closing this box, you consent to our use of cookies. To learn more, visit our privacy policy.