Portal Engine Questions on portal engine and web parts.
Version 6.x > Portal Engine > Access widget properties within HTML envelope content before area. View modes: 
User avatar
Member
Member
treed - 9/19/2012 5:27:37 PM
   
Access widget properties within HTML envelope content before area.
Is there a way for me to access properties I have set up for a widget with the HTML Envelope Content before area?

I have a property called HeaderTitle. I would like access and print out it's value in my HTML envelope. Is this this something I can do?

Thanks.

User avatar
Member
Member
kentico_michal - 9/20/2012 1:08:29 AM
   
RE:Access widget properties within HTML envelope content before area.
Hi,

Because a widget is based on a web part, you can access its properties just as you do in standard web parts using the following method: CMSAbstractWebPart.GetValue(string propertyName)

Best regards,
Michal Legen

User avatar
Member
Member
treed - 9/20/2012 10:09:48 AM
   
RE:Access widget properties within HTML envelope content before area.
Thanks. But what I'm trying to do is access the value from my widget properties screen, HTML Envelope section, Content before input area. I was hoping that there might be some type of macro or eval() syntax that would allow me to access the property from within that area. As using CMSAbstractWebPart.GetValue(string propertyName) doesn't seem to work there.

User avatar
Kentico Developer
Kentico Developer
kentico_helenag - 9/25/2012 3:56:54 AM
   
RE:Access widget properties within HTML envelope content before area.
Hello,


regrettably, there is no such macro or eval(). It is possible to use them only if they are document type properties (which you fill in on the Form tab). You can consider specifying 'title' on the Form tab.

In your current scenario, you can use the mentioned API method in:

a. a custom macro: Macros - the 'Custom macro' section. Then you can enter the macro to the web part properties.

b. a custom form control for a new web part property which you will use instead of Content before: Developing form controls


Best regards,
Helena Grulichova