Quantcast
Channel: Developer to developer
Viewing all articles
Browse latest Browse all 9076

How to: Get block Items from a ContentArea based on its type

$
0
0

I have a page type with a ContentArea as one of its properties

(currentPage.PrimaryComponentArea)

How can I get the block items stored in this property based on its type.

I also want to be to access properties on the block so I need to convert it from ContentAreaItem to the actuall block type.

 public ActionResult Index(RatePlanPageType currentPage)
        {
          ..........
          var allItems = currentPage.PrimaryComponentArea.Items;
          var blocks = allItems.Where(x => bla bla bla  < Can I do it using linq
        }

this is my first Episerver project so I hope this is not a stupid question.


Viewing all articles
Browse latest Browse all 9076

Trending Articles