Magento Forum

Dynamic Widget Configuration Options
 
p99076feb
Jr. Member
 
Total Posts:  4
Joined:  2010-12-14
 

Hi Guys,

I was wondering if anyone could help me out with the following problem. I am writing a widget and have a set of configuration options (eg 5 visible and 1 hidden). I would like to set the hidden option to visible once a specific config option has been set to a certain value.

I’ve been trying to find a solution but to no avail.

I would really appreciate any feedback.

Thank You,
Brendan

 
Magento Community Magento Community
Magento Community
Magento Community
 
webkul
Sr. Member
 
Avatar
Total Posts:  159
Joined:  2010-10-27
 

where you want this options means on the front-end or in the back-end ? General ideas is by default you can set as display:none and on evenetchange (using dom) you can set to display:block .Please let me know with further information

 
Magento Community Magento Community
Magento Community
Magento Community
 
p99076feb
Jr. Member
 
Total Posts:  4
Joined:  2010-12-14
 

Options as in the backend. When you insert a widget and choose your specific widget, you can manipulate the predefined options that come with the widget. Those are the options I was talking about. Sorry if I was unclear.

 
Magento Community Magento Community
Magento Community
Magento Community
 
p99076feb
Jr. Member
 
Total Posts:  4
Joined:  2010-12-14
 

Let me try to explain in the simplest way possible in case i’m being a bit foggy.

I’v created a widget (eg mywidget). Now I go into the backend and go into a page’s wysiwyg editor. I click on insert widget and use the dropdwon box provided to find my widget. Once I choose my widget the window fills up with a number of configuration options (as specified in my widget.xml file). Now what I need to do exactly is to make one of those options (optionA) hidden by <visible>0</visible> (for example) whenever I set another option’s value (optionB) (eg I choose a value from the dropdown box of optionB)

Thank you

 
Magento Community Magento Community
Magento Community
Magento Community
 
p99076feb
Jr. Member
 
Total Posts:  4
Joined:  2010-12-14
 

Hey Guys,

I’ve managed and am going to provide an example in case someone else is having the same problem

Let’s say I’ve created a widget and I’ve specified two widget options in the widget.xml file, these being:

<widget_this>
<required>1</required>
<visible>1</visible>
<label>Widget this</label>
<type>select</type>
<values>
<value_one>
<label>Type1</label>
<value>type1</value>
</value_one>
<value_two>
<label>Type2</label>
<value>type2</value>
</value_two>
</values>
</widget_this>

<widget_that>
<required>1</required>
<visible>1</visible>
<label>Widget that</label>
<type>text</type>
</widget_that>

Now we would like widget_that to be visible when a user selects Type2 from the widget_this dropdown box. To do that, add a <depends> tag. Therefore our new widget_that would look like:

<widget_that>
<required>1</required>
<visible>1</visible>
<label>Widget that</label>
<type>text</type>

<depends>
<widget_this>
<value>type2</value>
<widget_this>
</depends>
</widget_that>

 
Magento Community Magento Community
Magento Community
Magento Community
 
sunil_nextbits
Jr. Member
 
Total Posts:  11
Joined:  2011-11-24
 

Hello,

p99076feb—good solution.

I want to like this:-

Based on first option selection change into second option value in option.

Thanks,
Sunil

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top