Copied to clipboard

Flag this post as spam?

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


  • Rihab 104 posts 388 karma points
    Sep 10, 2018 @ 12:25
    Rihab
    0

    show vorto grid data

    hi everyone,

    i'm using vorto package with umbraco but i did not find a way to show the vorto grid data.

    can you give me a way to show the vorto grid data?

    thanks.

  • Alex Skrypnyk 6150 posts 24110 karma points MVP 8x admin c-trib
    Sep 10, 2018 @ 12:37
    Alex Skrypnyk
    0

    Hi

    Are you using vorto in the grid or grin in the vorto?

    Can you show that you tried?

    Alex

  • Rihab 104 posts 388 karma points
    Sep 12, 2018 @ 10:38
    Rihab
    0

    hi Alex,

    i'v tried this :

    @CurrentPage.GetGridHtml("projectGrid")
    

    and this

    @Html.Partial("Grid/bootstrap3", Model.Content.GetVortoValue("projectGrid"))
    

    and i'm geting this error :

            'Umbraco.Web.Models.RenderModel<Umbraco.Web.PublishedContentModels.HomePage1>' does not contain a definition for 'sections'
    

    in "\Views\Partials\Grid\Bootstrap3.cshtm"

    at this code line

    @if (Model != null && Model.sections != null)
    

    any Suggestions ??

  • Alex Skrypnyk 6150 posts 24110 karma points MVP 8x admin c-trib
    Sep 12, 2018 @ 15:02
    Alex Skrypnyk
    0

    Hi

    Model.sections - will no work, all property names should be capitalized, so try:

    Model.Sections
    

    Or:

    Model.HasValue("sections")
    

    Check, please, alias of property you want o to render.

    Thanks,

    Alex

  • Rihab 104 posts 388 karma points
    Sep 13, 2018 @ 07:10
    Rihab
    0

    Hi Alex,

    thanks for replying,

    it's not working.

    PS :that error only shows after changing the editor to Vorto grid and it's from Partials\Grid\Bootstrap3.cshtm

  • Frans de Jong 548 posts 1840 karma points MVP 4x c-trib
    Sep 13, 2018 @ 07:15
    Frans de Jong
    0

    The capital s is not the problem. The grid cshtml works with small characters.

        @inherits UmbracoViewPage<dynamic>
    @using Umbraco.Web.Templates
    @using Newtonsoft.Json.Linq
    
    @if (Model != null && Model.sections != null)
    {
        var oneColumn = ((System.Collections.ICollection)Model.sections).Count == 1;
    
        <div class="umb-grid">
            @if (oneColumn)
            {
                foreach (var section in Model.sections) {
                    <div class="grid-section">
    

    etc.

  • Frans de Jong 548 posts 1840 karma points MVP 4x c-trib
    Sep 13, 2018 @ 07:16
    Frans de Jong
    100

    Does the language you are currently using have a value?

  • Rihab 104 posts 388 karma points
    Sep 13, 2018 @ 08:00
    Rihab
    0

    thank you soooooo much,

    I feel like a fool.

  • Frans de Jong 548 posts 1840 karma points MVP 4x c-trib
    Sep 13, 2018 @ 08:23
    Frans de Jong
    0

    No problem. Happens all the time.

    You can check if the value exists by using .HasVortoValue("valuename") If no value for this language is present you could always default back to another language, show a message or redirect to somewhere

Please Sign in or register to post replies

Write your reply to:

Draft