0

Getting error 'Umbraco.Cms.Web.BendyContentList' does not contain a definition for 'Children'

While trying to use

@inherits RenderViewPage
@using System.Web.Mvc.Html
@using Umbraco.Cms.Web;
@using Umbraco.Framework;
@using Umbraco.Framework.Persistence;
@{
    ViewBag.Title = "FAQs";
    Layout = "Layout.cshtml";

    var accordionTitle = DynamicModel.Children.Where("NodeTypeAlias == \"supportAccordion\"");
    var accordionItem = DynamicModel.Children.Where("NodeTypeAlias == \"supportAccordionItem\"");

}

<section class="support-wrapper">

    <h1>Help & Frequently Asked Questions</h1>

    <section class="questions">

    @foreach (var item in accordionItem)
    {
    <h2>@accordionTitle.title</h2>

        <h3><a href="#">@item.question</a></h3>
        <div>
            <p>@item.answer</p>
        </div> 


    }

    </section><!-- end questions -->

</section><!-- end section wrapper -->

I've looked at http://our.umbraco.org/forum/core/umbraco-5-general-discussion/27856-razor-in-Umbraco-5-filtering-child-nodes-by-doc-type But still not working.

My Umbraco tree looks like the following. I've put the Document Type name in Red.

enter image description here

There's not much documentation out on Umbraco 5 yet as it was recently released. Does anyone know what could be the issue?

Thanks!

Christopher Marshall
  • 10,678
  • 10
  • 55
  • 94

1 Answers1

1

I think you're running on an older release than the RTM, as BendyContentList was removed from the codebase and the code you have should work fine.

Could you check the version you're running? This can be done by checking the About button the top right corner of the backoffice.

Alex Norcliffe
  • 2,439
  • 2
  • 17
  • 21