Handles

Thảo luận trong 'Kho download Module, extensions cho magento' bắt đầu bởi phuong.hoang, 15 Tháng năm 2012.

  1. phuong.hoang

    phuong.hoang Hoàng Thị Phương

    [​IMG]
    The Handles module allows for new layout handles to be added easily. It is aimed towards developers who wish to add layout handles to pages with minimum fuss.

    It was inspired by the need to have different layout handles for the empty basket page, empty search results page and empty category pages. As such, these three use cases have been addressed and are included with the module and can be used as is or as references for further extending and adding custom layout handles.

    To add a new layout handle, please refer to the following

    Find the module name, controller name and controller action of the page that you want to add a new layout handle for. For example, the search results page would be Catalogsearch (module), Results (controller) and index (action)
    All new layout handles are created by extending Dh_Handles_Model_Handler_Abstract and by implementing the execute() method.
    Navigate to app/code/local/dh/handles/model/handler/ and create a folder for each of the module and controller mentioned above. Inside the folder created for the controller create a class based on the action.
    Use the execute method to hold the logic for adding the new layout handle and within that method call $this->_addHandle('handle name here') to add the new handle.
    Have a look in the following class for an example on how this is done: Dh_Handles_Model_Handler_Checkout_Cart_Index

    Any questions, get in touch

    Các file đính kèm:

    Bài viết khác cùng chuyên mục:

Chia sẻ trang này