Git Product home page Git Product logo

Comments (7)

wiedikerli avatar wiedikerli commented on August 16, 2024

WE MADE IT 🙀🎉🎉

you could do it like that

@inherits UmbracoViewPage<Lecoati.LeBlender.Extension.Models.LeBlenderModel>
@using Archetype.Models;
@using Newtonsoft.Json.Linq;
@{

    if (Model.Items.Any())
    {
        var title = Model.Items.First().GetValue<string>("title");

        <h3>@title</h3>

        var listItem = Model.Items.First().GetValue<dynamic>("listItem");


        if (listItem != null && listItem.fieldsets != null && Enumerable.Any(listItem.fieldsets))
        {
            JArray fieldsetListItem = listItem.fieldsets;
            var list = fieldsetListItem.ToList();

            var countItems = (decimal)list.Count();
            var firstItems = Math.Ceiling(countItems / 2m);

            <div class="product-benefit-content row">
                <div class="product-benefit-content-box col-xs-12 col-sm-12 col-md-6">
                    @foreach (JObject item in list.Take((int)firstItems))
                    {
                        JArray properties = (JArray)item.GetValue("properties");
                        JObject property = (JObject)properties[0];
                        var value = property.GetValue("value");

                        <div class="product-benefit-content-box-item">
                            <i class="fa fa-check-circle"></i>
                            <p>@Html.Raw(value)</p>
                        </div>
                    }

                </div>
                <div class="product-benefit-content-box col-xs-12 col-sm-12 col-md-6">
                    @foreach (JObject item in list.Skip((int)firstItems))
                    {
                        JArray properties = (JArray)item.GetValue("properties");
                        JObject property = (JObject)properties[0];
                        var value = property.GetValue("value");

                        <div class="product-benefit-content-box-item">
                            <i class="fa fa-check-circle"></i>
                            <p>@Html.Raw(value)</p>
                        </div>
                    }
                </div>
            </div>
        }
    }
}

from leblender.

agiraud avatar agiraud commented on August 16, 2024

You rock Tobias ! good stuff.

There is a known issue about the data converter, we will upload a parche for this soon.

Thanks for your feedback

from leblender.

kipusoep avatar kipusoep commented on August 16, 2024

Model.Items.Single().GetValue<ArchetypeModel>("archetypeProperty")
Works for me...

from leblender.

wiedikerli avatar wiedikerli commented on August 16, 2024

@kipusoep what versions are you using?

from leblender.

agiraud avatar agiraud commented on August 16, 2024

since the version 1.0.4, property converter issue is fixed and works fine

from leblender.

kipusoep avatar kipusoep commented on August 16, 2024

Umbraco 7.2.5
LeBlender 1.0.4
Archetype 1.7.5

from leblender.

soreng avatar soreng commented on August 16, 2024

Seems to be solved by supporting Umbraco PropertyValue Converters

from leblender.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.