How can I make a parameter for a partial view macro that will be a drop down list or radio list or multiple options list?
Requirement:
User to select an image with text that appears if you click on an icon overlaying the image. The partial view parameter is to be a selection for the icon overlay. Something like: Choose your icon overlay image - options: light, dark, left, center, right...
I have just recently done this in the project I am working on. You need to create a folder in App_Plugins and give it a name. My example was called CornerPosition. It gave me a drop down list to select "Top Right", "Bottom Left" etc.
within the folder create two following files and code within:
Since I did this, I needed to update the values in the drop down. I've changed the html "select", but I can't get it to update in the application. Any ideas?
Thanks. That worked. However, I found that there are issues with browser cache. Opening it in my usual browser (chrome) showed the old values. Opening it in a different browser (IE) showed the new updated values. Umbraco version 7.2.6.
Partial view macro custom parameter
Hello.
How can I make a parameter for a partial view macro that will be a drop down list or radio list or multiple options list?
Requirement: User to select an image with text that appears if you click on an icon overlaying the image. The partial view parameter is to be a selection for the icon overlay. Something like: Choose your icon overlay image - options: light, dark, left, center, right...
Leon
I have just recently done this in the project I am working on. You need to create a folder in App_Plugins and give it a name. My example was called CornerPosition. It gave me a drop down list to select "Top Right", "Bottom Left" etc.
within the folder create two following files and code within:
package.manifest
select.html
Rebuild and restart your project, and you should find your new custom macro parameter available on the properties page.
YAY!! It worked. That's brilliant. Thank you very much. You're the best!
You're welcome :)
Hi Chris.
Since I did this, I needed to update the values in the drop down. I've changed the html "select", but I can't get it to update in the application. Any ideas?
Yes. After building you need to "touch" the web.config file, just add a space somewhere and save it. Then refresh the website.
Thanks. That worked. However, I found that there are issues with browser cache. Opening it in my usual browser (chrome) showed the old values. Opening it in a different browser (IE) showed the new updated values. Umbraco version 7.2.6.
is working on a reply...