Hello, Here is the thing.
I cloned Kentico BizForm as in http://devnet.kentico.com/docs/7_0/devguide/index.html?resolving_macros_using_api.htm Next, i added a custom field in my new web-part throuht Kentiko CMS. Next, configured menu item throught design section.
I have a problem here - I need to resolve this macros in code-behind. I think i need -
CMSContext.CurrentResolver.ResolveMacros(str); or this.ResolveMacros(str); I try to use GetValue to obtain value from my field - but it just "eats" macro.
So, how can i do something like this: var str = this.GetValue("MyValue"); //for example MyValue = "{%Test%}"; // i want str to be "{%Test%}" // but str == "" this.ResolveMacros(str);
Okay, thanks, there is a dirty hack.
this.DisableMacros = true; //disable macros var str = this.GetValue("MyValue"); //str == "{%Test%}", yaay this.DisableMacros = false; //enable macros.
Quick pastebin link, sorry http://pastebin.com/D77ihNuK
Adding the property within the Kentico UI for the webpart is only half of the chore. You also need to modify the code behind and add a public property named the same. Take a look at the webpart dev docs.
Please, sign in to be able to submit a new answer.