What is the maximum level of Expand parameter for Content Areas?

Vote:
 

We have a page strucutre with 3-4 levels of nested blocks inside of Content Areas. 
Simplified example :

public class Level2Block : BaseBlock
{
    public virtual string Name { get; set; }

    public virtual int Age { get; set; }
}


public class Level1Block : BaseBlock
{
    [AllowedTypes(typeof(Level2Block))]
    public virtual ContentArea Level2 { get; set; }
}


class MyPage : BasePage 
{
    [AllowedTypes(typeof(Level1Block))]
    public virtual ContentArea Level1 { get; set; }
}

The problem is that Content Delivery Api with expand=* will expand only Level1  property,

but Level2 property will not be expanded and will contain a list of content links to contained Level2 blocks.

Is there any solution or at least a reason of what is going on?

#289152
Oct 13, 2022 10:06
Vote:
 

Personally I always have a design practice in place to only ever allow 2 levels at max. A block in page and block in that block when really needed but reducing the number of blocks is key.

However you can configure the number of expanded levels with the package documented here https://www.hiddenfoundry.com/thoughts/expand-content-area-addon-for-content-delivery-api/ 

services.ConfigureRecursiveContentAreaContentApiOptions(o =>
    o.MaxExpandContentAreaLevels = 4;
});
#289153
Edited, Oct 13, 2022 10:55
klappo - Oct 13, 2022 11:56
thanks so much for the answer
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.