While I'm at it, I also need to access the tab it belongs to. So when adding a property, it's the dropdown that is labelled with:
"Place under heading:"
Any ideas?
Cheers!
Hi Karl!
Let's see, you should be able to get them using something like this:
Tab:
TabDefinition tab = CurrentPage.Property["myProp"].Tab;
Property type name:
string propTypeName = PageDefinition.Load(CurrentPage.Property["myProp"].PageDefinitionID).Type.LocalizedName;
I've not actually tested this, so I may have made some stupid error, but something along those lines should give you what you want.
Regards
Per Gunsarfs
EPiServer CMS development team
Hi Per,
Thanks for getting back to me so quickly!
I've tried both of those suggestions, but no luck.
There's no tab property, but there is a ownertab property!
I used this:
TabDefinition tab = TabDefinition.Load(propData.OwnerTab);
And for my type, that code worked exactly, though I had to catch the empty types!
Thanks very much!
Cheers,
Karl.
Hi
Sorry, doublechecked and you are correct there is no Tab property on PropertyData, don't know how I read the SDK yesterday. It's of course PageDefinition that has a Tab property But it seems like you solved your problems anyway :)
If these kind of problems my suggestion is to start with the classes PropertyData and PageDefinition. From there you can get most such information.
Regards
Per Gunsarfs
Hi,
I'd like to programmatically access the type of a property. So I'll fetch the property the conventional way, and then I'd like to grab the bit that specifies whether it's: