I'm working on a Magento module where i want to fetch the layout from a frontend page. By frontend page i mean all types of pages, i.e. cms page, category, product, cart, my account, etc.
I've read the excellent magento-nofrills ebook from Alan Storm and i'm using his Commercebug plugin to help me develop my magento site. I've also spent some time on stackoverflow looking for a similair question, please forgive me if i have missed it.
If for example i have a page id or category id, how do i fetch the layout of that frontend page from code run in the backend?
I've been playing with the request and when i run this code in the frontend i can see that the module, controller, layouthandles etc are changed when for instance looking at a catalog page
$request = Mage::app()->getRequest();
$request->setModuleName('cms');
$request->setRouteName('cms');
$request->setControllerName('page');
$request->setActionName('view');
$request->setParam('page_id', 6);
But when i inspect the xml from the layout, i can't seem to force magento to show me the xml for (in this example) cms page with id=6:
Mage::app()->getLayout()->getNode()->asXml();
Maybe i'm thinking way too complicated though. I would like to check if a certain page has sidebars, which blocks and elements are shown on the page and in the sidebars (only active blocks, not the ignored ones).
Thanks in advance! Tim