November Happy Hour will be moved to Thursday December 5th.
November Happy Hour will be moved to Thursday December 5th.
I'm not quite sure I follow but here are some things that might lead you in the right direction:
You're getting a property group wih the extension method GetPropertyValue. For property groups there is another extension method called GetPropertyGroupPropertyValue.
The name of the property that gets created consists of what you name the property group in your page as well as the actual property defined in the group. Let's say you have a property group called MyPropertyGroup with a property called MainBody. On your page type you add the property group MyPropertyGroup and name it ContactInfo. The property would then (if you look at it on page type in admin mode) be called ContactInfo-MainBody.
Does that help?
Hello
Is "GetPropertyGroupPropertyValue"-extension-method supposed to be in PageTypeBuilder.PageDataExtensionMethods? Cant find this e-method in PTB 1.9.2?
Thanks!
Hmm, that may have come in v2 then (although I'm not certain). The methods themselves are in PageTypeBuilder.PageTypePropertyGroupExtensions.
Hello
I have problems to fetch PropertyGroups programmaticly and I dont know if I'm not understanding or if its a bug. I'm using PTB 1.9.2.0 and EPi 6 R2 and I have a Propertygroup that looks like:
public class MyPropertyGroup : PageTypePropertyGroup
{
[PageTypeProperty(Type = typeof(PropertyPageReference), SortOrder = 10, DisplayInEditMode = false)]
public virtual PageReference FavoriteProperty { get; set; }
.
.
}
in my "main page" I do:
[PageType("<someguid>", Filename = "<some view path>", SortOrder = 1830)]
public classMyMainPageType : <BasePageType>,<Some interfaces>
{
[PageTypePropertyGroup(StartSortOrderFrom = 50)]
public virtual <My return Property of propertyGroup> FavoriteProperty { get; set; }
.
.
}
The problem I have is I have to fetch this property programmaticly from a pagedata extension method that has signature:
public static TProperty GetGroupPropertyValue<TPageData, TProperty>(this TPageData pageData, Expression<Func<TPageData, object>> expression)
where TPageData : TypedPageData, <Some interfaces>
and in that method I do:
var value = pageData.GetPropertyValue<TProperty>(<nameOfProperty>); <nameOfProperty> is gotten in method by string manipulation and is in this case "MyPropertyGroup"
even if I can see that this property is set in editmode this method above returns null and I cant figure out whats wrong and will be happy if anyone could point me in right direction what to do to get PropertyGroups programmaticly
Regards!