Skip to content

[Bug]: Duplicate data when creating template #6

Description

@thientu995

What browsers are you seeing the problem on?

No response

What happened?

Hi everyone!

I am using this source example and creating more Block Grid Content Template (available in source).

Right at the BlockGrid.cshtml file, I added my line of code as follows:

@inherits Umbraco.Cms.Web.Common.Views.UmbracoViewPage<ContentModels.BlockGrid>
@using ContentModels = Umbraco.Cms.Web.Common.PublishedModels;
@{
    Layout = "Layout.cshtml";
}

@await Html.GetBlockGridHtmlAsync(Model.Content)

@{
    var children = Model.Children;
    if (children.Any())
    {
        foreach (var item in children)
        {
    <div style="padding-top:1000px">
        @await Html.GetBlockGridHtmlAsync((item as ContentModels.BlockGrid).Content);
    </div>
        }
    }
}

Then I immediately created 5 templates with another content in page Home:
image

Then return to my homepage to see the results, duplicate previous data is hard to understand?

Video Demo: https://drive.google.com/file/d/1tSUKe74nQVZNjgRZbXjVp5r_EfJcVUpu/view?usp=sharing

Source code: https://drive.google.com/file/d/1gS6DL6il58eYRM8-pUwLdE133KmEzKg0/view?usp=sharing

It seems that this problem is similar to BlockList: umbraco/Umbraco-CMS#13413

Thanks!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions