Skip to content

Commit 4d2a215

Browse files
author
Lucas van Staden
committed
add in category layout handle
1 parent a16c63a commit 4d2a215

3 files changed

Lines changed: 15 additions & 2 deletions

File tree

README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,14 @@ The template itself would simply the the field:
105105
</div>
106106
</li>
107107

108+
Fixes Category Layout Handles
109+
=============================
108110

109-
Our Premium extensions:
111+
ref: http://stackoverflow.com/questions/20249894/magento-1-7-how-to-use-the-page-layout-handle
112+
Will now inject the category handle, allowing you to target teh category via its own layout handle as set in admin
113+
114+
115+
Premium extensions:
110116
----------------------
111117
[Magento Free Gift Promotions](http://www.proxiblue.com.au/magento-gift-promotions.html "Magento Free Gift Promotions")
112118
The ultimate magento gift promotions module - clean code, and it just works!

app/code/community/ProxiBlue/GlobalHandle/Model/Observer.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,13 @@ public function controller_action_layout_load_before($observer)
3232
$urlKey = str_replace('-', '_', strtolower($category->getUrlKey()));
3333
$layout->getUpdate()->addHandle('CATEGORY_' . $name);
3434
$layout->getUpdate()->addHandle('CATEGORY_' . $urlKey);
35+
// inject custom page layout handle
36+
// ref: http://stackoverflow.com/questions/20249894/magento-1-7-how-to-use-the-page-layout-handle
37+
$design = Mage::getSingleton('catalog/design');
38+
$settings = $design->getDesignSettings($category);
39+
if($settings->getPageLayout()) {
40+
$layout->getUpdate()->addHandle($settings->getPageLayout());
41+
}
3542
}
3643
}
3744

app/code/community/ProxiBlue/GlobalHandle/etc/config.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<config>
33
<modules>
44
<ProxiBlue_GlobalHandle>
5-
<version>1.0.1</version>
5+
<version>1.0.2</version>
66
</ProxiBlue_GlobalHandle>
77
</modules>
88
<global>

0 commit comments

Comments
 (0)