Blocks can be used as both blocks in pages and shared within page content. You'd be best changing TestPage1 to inherit from block and that will render those groups of items in page. You'll then be able to use the standard properties
Hi Scott,
We dont want to use Block in this case as the class are specific object model which will merged to form a main Pagedata model. As there are large number of properties, so we are divinding it into specific class object model.
//ashish
Hi Ashish.
I would agree with Scott - it does look somewhat strange to create a property, containing multiple properties, with Name included in it's classname. Not sure I fully understand the rationale behind not creating a shared block model, but maybe it would be more beneficial for you to create an abstract PageType containing these shared properties, which all your relevant PageTypes then inherit from. Your example looks like a another way of achieving inheritance.
If you don't find inheritance beneficial, because of some misunderstood point on my end, do you then mind sharing your controller and view, which is what takes care of the rendering for both end-users and editors. Then we can help you with your current direction of implementation.
/Casper Aagaard Rasmussen
There are basically 3 options which can be combined
1 and 2 is more relevant for a "has a" relation. Article page has SEO information.
3 is the way to go for "is a" relationship. BicycleProductPage is a ProductPage.
By using standard OOP principles like interfaces you'll be able to simplify and generalize logic in controllers and services.
Hi ,
I have a simple class as:
public class TestPage1
{
public virtual string Page1PropertyA { get; set;}
public virtual string Page1PropertyB { get; set;}
}
Now I want to use this as a property in a pagedata class, I use it as below:-
public class MyPage: PageData
{
[CultureSpecific]
public virtual TestPage1 TestPageProperty { get; set; } // (or any object you prefer)
}
I also created a base custom property for the same:-
[PropertydefinationtypePlugin]
public class PageObjectProperty : Property
{
string outputAsJson;
public PageObjectProperty()
{
_objectSerializer = this._objectSerializerFactory.Service.GetSerializer("application/json");
//outputAsJson = JsonConvert.SerializeObject(T);
}
private Injected _objectSerializerFactory;
private IObjectSerializer _objectSerializer;
public override PropertyData ParseToObject(string value)
{
ParseToSelf(value);
return this;
}
}
But i am not getting the class object with all its properties render in edit mode ? iHow can I achieve the same.
It works when i use PropertyList<> and create class object list, but not for single object instance.>
Kindly help