Thursday, 15 September 2011

php - Add dynamic value to menu in Magento -



php - Add dynamic value to menu in Magento -

i want add together link left navigation on user dashboard.i can add together static link using code :

<action method="addlink" translate="label" module="pmembers"><name>sellermessages</name><path>social/members/20/messages/</path> <label>social settings</label></action>

but want set 20 dynamically.how can ?

use helper that.

create module (or utilize existing one) , create helper

class namespace_yourmodule_helper_dynamic extends mage_core_helper_abstract { function dynamicparameter() { // implement logic determine parameter $dynamic = 20; homecoming "social/members/" . $dynamic . "/messages"; } }

and in layout update file use

<action method="addlink" translate="label" module="pmembers"> <name>sellermessages</name> <path helper="yourmodule/dynamic/dynamicparameter" /> <label>social settings</label> </action>

php xml magento

No comments:

Post a Comment