Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Brygger92 5 posts 75 karma points
    1 week ago
    Brygger92
    0

    Nested Content in newer versions of umbraco

    what do you use instead of nestedContent in the newer versions of umbraco

    since it does not exist in 11.1.0 but it does in 8.14

    im sitting and updating the program

  • Garðar Þorsteinsson 104 posts 484 karma points
    1 week ago
    Garðar Þorsteinsson
    1

    Hi,

    I would recommend to use Block List.

    If you want it to work more like Nested Content you can choose inline editing mode on the datatype.

  • Lungelo Keswa 10 posts 90 karma points
    1 week ago
    Lungelo Keswa
    0

    hi i'm using block list i was doing nested content with it in umbraco 10 it was fine. now using umbraco 11 having issues with when i' using ITEM.CONTENT

    do you know how i can fix this please

    var rowItem = (AccordionItem)item.Content;
    
    @inherits UmbracoViewPage<BlockGridItem<AccordionRow>>
    @{
        var rowAccordion = (AccordionRow)Model.Content;
        if (rowAccordion.AccordionDetails == null || !rowAccordion.AccordionDetails.Any()) return;
        var accordionId = "accordion-" + rowAccordion.Key;
    }
    
    <div cite="row">
        <div class="container">
    
            <div id="@accordionId">
    
                @{
                    var index = 0;
    
                    foreach (var item in rowAccordion.AccordionDetails)
                    {
    
                        var rowItem = (AccordionItem)item.Content;
    
                        var show = index == 0;
                        var headingId = accordionId + "heading-" + index;
                        var collapseId = accordionId + "collapse-" + index;
    
                                <div class="card">
                                    <div class="card-header" id="@headingId" style="margin-left: 0!important; margin-right: 0!important">
                                        <h5 class="mb-0">
                                            <button class="btn btn-link" data-toggle="collapse" data-target="@collapseId" aria-expanded="@show" aria-controls="@collapseId">
                                        @rowItem.Title
                                            </button>
                                        </h5>
                                    </div>
    
                                    <div id="[email protected]" class="collapse @(show ? "show" : null)" aria-labelledby="@headingId" data-parent="@accordionId">
                                        <div class=" card-body">
                                    @rowItem.Content
                                        </div>
                                    </div>
                                </div>
                        index++;
                    }
                }
    
            </div>
    
        </div>
    </div>
    
  • Huw Reddick 1031 posts 3490 karma points c-trib
    1 week ago
    Huw Reddick
    0

    Is that your exact code? Yo have this at the top, but item is not defined there

    var rowItem = (AccordionItem)item.Content;
    

    It would also help if you could provide the error you are getting.

  • Lungelo Keswa 10 posts 90 karma points
    1 week ago
    Lungelo Keswa
    0

    Oh sorry man here is the error message

    'char' does not contain a definition for 'Content' and no accessible extension method 'Content' accepting a first argument of type 'char' could be found (are you missing a using directive or an assembly reference?)

  • Lungelo Keswa 10 posts 90 karma points
    1 week ago
    Lungelo Keswa
    0

    hi Garðar Þorsteinsson can you please help me out with this error kinder stuck.

Please Sign in or register to post replies

Write your reply to:

Draft