You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
New handles for the Category, Product and CMS pages #102
If you are viewing a category: /products/dvds.html (category id: 5)
You'll get a handle by default: CATEGORY_5
We add the following:
Handle: CATEGORY_2_child_child
Category 2 is the root category for this store, so allows for store specific configuration. If the category path is
longer it will show something like CATEGORY_2_child_child_child
Handle: CATEGORY_2_child_dvds
This one is kinda cool, this one allows you have one layout for multiple childcategories. Imagine the following categories:
/playgroup/books.html
/kindergarten/books.html
/elementary/books.html
All these categories will have the CATEGORY_2_child_books handle, so you can all style them the same!
Handle: CATEGORY_3_child
Child of a certain category.
If the category path is longer it will show something like CATEGORY_3_child_child.
Add category handle to product page.
The same as for the category applies, except everything is prefixed with PRODUCT_CATEGORY_ instead of CATEGORY_.
Add attribute set handle to product page
PRODUCT_ATTRIBUTE_SET_default
For styling based on the attribute set handle.
Add handles to CMS page
If you have the page: customerservice/faq/question_one, you'll get the following handles (same idea as for the categories):
Hi. Thank you for your proposal.
We can implement most of the ideas, but with some modifications.
Here is major resolution:
Add handles to category page:
"CATEGORY_2_child_child" will be transformed to "catalog_category_view_id_2_child_level_2"
"CATEGORY_2_child_dvds"
It's bad practice to make dependance on user input at handle (category name in this case). To apply some layout update to few dvd categories you can reorganize your catalog or make updates for few handles. Will it work for you? If no, can you propose alternative way without using category name for layout handle?
Add category handle to product page:
"PRODUCT_CATEGORY_" => "catalog_product_view_category_id_"
Add attribute set handle to product page:
"PRODUCT_ATTRIBUTE_SET_default" - same situation as with category name. Better to use attribute set id for handle: "catalog_product_view_attribute_set_id_1"
Thanks for responding and implementing this feature :)
It's bad practice to make dependance on user input at handle (category name in this case). To apply some layout update to few dvd categories you can reorganize your catalog or make updates for few handles. Will it work for you? If no, can you propose alternative way without using category name for layout handle?
That requires me to update the XML for each new category (admin, files, doesn't matter, will have to update somewhere), think that solution is a bit less smooth (especially with automatic imports), but I don't really have a better solution.
The other suggestions are fine, dont really care how they are written down, just that they are :)
Cant we have an attribute in categories that let's us specify a category-handle manually? I know, it is still user input - but then it would be clear, that the input affects the layout.
Cant we have an attribute in categories that let's us specify a category-handle manually? I know, it is still user input - but then it would be clear, that the input affects the layout.
There really isn't that much difference to require someone to copy some XML or to copy some string:
Example XML (this is for Magento 1, but I think Magento 2 will be about the same):
Not sure what it was like in 2012 but that would be nice to have possibility to disable additional (product_id,sku/category_id) handles.
Check my comment #189 (comment)
Now we have thousands of entries in the cache storage that we do not need...
@ilnytskyi Wow, that is an old issue! I don't thing you'll get any meaningful response. In 2012 this looked like a great idea, but not so much any more ;)
Activity
magento-team commentedon Jan 11, 2013
Hi. Thank you for your proposal.
We can implement most of the ideas, but with some modifications.
Here is major resolution:
Add handles to category page:
"CATEGORY_2_child_child" will be transformed to "catalog_category_view_id_2_child_level_2"
"CATEGORY_2_child_dvds"
It's bad practice to make dependance on user input at handle (category name in this case). To apply some layout update to few dvd categories you can reorganize your catalog or make updates for few handles. Will it work for you? If no, can you propose alternative way without using category name for layout handle?
Add category handle to product page:
"PRODUCT_CATEGORY_" => "catalog_product_view_category_id_"
Add attribute set handle to product page:
"PRODUCT_ATTRIBUTE_SET_default" - same situation as with category name. Better to use attribute set id for handle: "catalog_product_view_attribute_set_id_1"
paales commentedon Jan 11, 2013
Thanks for responding and implementing this feature :)
That requires me to update the XML for each new category (admin, files, doesn't matter, will have to update somewhere), think that solution is a bit less smooth (especially with automatic imports), but I don't really have a better solution.
The other suggestions are fine, dont really care how they are written down, just that they are :)
amenk commentedon Jan 14, 2013
Cant we have an attribute in categories that let's us specify a category-handle manually? I know, it is still user input - but then it would be clear, that the input affects the layout.
paales commentedon Jan 14, 2013
There really isn't that much difference to require someone to copy some XML or to copy some string:
Example XML (this is for Magento 1, but I think Magento 2 will be about the same):
magento-team commentedon May 13, 2013
The Technical Task created to resolve this problem.
Merge pull request #102 from magento-qmt/develop
Merge pull request #102 from magento-firedrakes/bugfixes
Merge pull request magento#102 from magento-troll/MAGETWO-53557
Merge pull request #102 from WeareJH/67-eliminate-zend-mime-usage
ENGCOM-2320: Fix the category tree depth calculation bug #102
ENGCOM-2320: Fix the category tree depth calculation bug #102
Merge pull request magento#102 from magento-pangolin/MC-11063
ENGCOM-5205: fix AsynchronousOperations multistore issue by passing s…
Merge pull request #102 from magento-arcticfoxes/MC-20181
ilnytskyi commentedon Sep 24, 2020
Not sure what it was like in 2012 but that would be nice to have possibility to disable additional (product_id,sku/category_id) handles.
Check my comment #189 (comment)
Now we have thousands of entries in the cache storage that we do not need...
paales commentedon Sep 24, 2020
@ilnytskyi Wow, that is an old issue! I don't thing you'll get any meaningful response. In 2012 this looked like a great idea, but not so much any more ;)
ilnytskyi commentedon Apr 24, 2021
When we removed entity ids from layout handles. We reduced used cache space significantly and it also improved overall page performance.
