1

When updating layout handle i need to call some function from block from which i am updating. I want to basically to set some menu links as active but no success with this code

    <customer_account_myact>
        <update handle="customer_account">
            </update>
            <reference name="left">
                <block type="customer/account_navigation" name="customer_account_navigation" before="-" template="customer/account/navigation.phtml">
                    <action method="setActive"><path>customer/account/MyServices/</path></action>
                </block>
            </reference>
    </customer_account_myact>

When I do 'update handle="customer_account"', it renders the all links in left sidebar menu, but what i need is to make certain link "active" so i am trying to to refer to block to call the action from there.

This is all i want, but when i do so it breaks all stuff and no links are rendered.

If i can, I suppose it should be possible to re declare all the links via xml and calling the block method, but i believe that there should be an easier, and, more correct way of doing this, just to leave it as is, but calling the method from block?

thanks!

  • 1
    Do you mean to create a new block rather than reference and existing one here? – Jonathan Hussey Dec 8 '15 at 14:53
  • when i do 'update handle="customer_account"' it renders the all links in left sidebar menu, but what i need is to make certain link "active" so i am trying to to refer to block to call the action from there. this is all i want, but when i do so it breaks all stuff and no links are rendered. as i can suppose it should be possible to redeclare all the links via xml and call the block method, but i beleive there should be easier, and, more correct way of doing this, just to leave it as is, but call the method from block? thanks! – Ilja Dec 8 '15 at 15:28
  • @Anonymous please add the comment info to your question for readability – Sander Mangel Dec 8 '15 at 16:03
1

It was just required to refer the layout reference name, instead of redeclaring a reference:

       <reference name="customer_account_navigation">
                <action method="setActive"><path>customer/account/MyAction/</path></action>
        </reference>
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.