Copied to clipboard

Flag this post as spam?

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


  • Brygger92 9 posts 79 karma points
    Jan 19, 2023 @ 09:57
    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 119 posts 565 karma points
    Jan 19, 2023 @ 10:08
    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 16 posts 97 karma points
    Jan 20, 2023 @ 09:49
    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="collapse-@index" 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 1929 posts 6717 karma points MVP 2x c-trib
    Jan 20, 2023 @ 10:59
    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 16 posts 97 karma points
    Jan 20, 2023 @ 11:03
    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 16 posts 97 karma points
    Jan 23, 2023 @ 21:04
    Lungelo Keswa
    0

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

  • Nik 1617 posts 7263 karma points MVP 7x c-trib
    Jan 31, 2023 @ 22:51
    Nik
    0

    Hi Brygger92,

    Did you manage to solve your issue in the end?

    Nik

Please Sign in or register to post replies

Write your reply to:

Draft