Copied to clipboard

Flag this post as spam?

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


  • Søren Kottal 712 posts 4570 karma points MVP 6x c-trib
    Oct 30, 2014 @ 11:27
    Søren Kottal
    1

    Vorto and the new grid?

    Has anyone tried using Vorto with the new grid?

    If its possible - how do you use GetGridHtml()?

  • Søren Kottal 712 posts 4570 karma points MVP 6x c-trib
    Oct 30, 2014 @ 11:42
    Søren Kottal
    103

    It works :)

     

    But a little workaround was needed.

     

    In stead of CurrentPage.GetGridHtml("grid") you have to write Html.Partial("Grid/bootstrap3",Model.Content.GetVortoValue("grid"))

  • Simon 692 posts 1068 karma points
    Jan 16, 2017 @ 09:17
    Simon
    0

    Hi guys,

    I am trying to render the grid which is wrapped in Vorto:

    @Html.Partial(MVC.Partials.Views.Grid.Bootstrap2, 
                          Model.CurrentPageAsBasePage.GetVortoValue(ConstantValues.Umbraco_Body_Text_Alias));
    

    but it is not working/rendering.

    It throwing an error in view:
    
    'string' does not contain a definition for 'sections'
    
    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 
    
    Exception Details: Microsoft.CSharp.RuntimeBinder.RuntimeBinderException: 'string' does not contain a definition for 'sections'
    
    Source Error: 
    
    
    Line 7:  *@
    Line 8:  
    Line 9:  @if (Model != null && Model.sections != null)
    Line 10: {
    Line 11:     var oneColumn = ((System.Collections.ICollection)Model.sections).Count == 1;
    
    Source File: c:\Repository\Clients\Current\CSTemplate\www\CSTemplate\Views\Partials\Grid\Bootstrap2.cshtml    Line: 9 
    
    Stack Trace: 
    

    Are there any solution please for this or how I can sort it out?

    Thanks in advance.

  • Simon 692 posts 1068 karma points
    Mar 20, 2017 @ 12:49
    Simon
    0

    Hi Guys,

    The above suggestion was not working for me.

    Actually the solution for it was the following:

    GridDataModel.Deserialize(Model.Content.GetVortoValue("pagecontent"));
    

    Actually, we had to deserialize the json value as string to the GridDataModel.

    then calling it @Html.Partial(MVC.Partials.Views.Grid.Bootstrap2, GridDataModel.Deserialize(Model.Content.GetVortoValue("pagecontent"));

    Hope it helps someone

  • Lee Kelleher 4026 posts 15836 karma points MVP 13x admin c-trib
    Oct 30, 2014 @ 12:32
    Lee Kelleher
    0

    Hi Søren, genuine question - did you have a need for using the new Grid within a Vorto? or was it an experiment?

    Thanks,
    - Lee

  • Søren Kottal 712 posts 4570 karma points MVP 6x c-trib
    Oct 30, 2014 @ 12:38
    Søren Kottal
    0

    I needed to use the grid in a Vorto. Anything I should be worried/aware about?

  • Lee Kelleher 4026 posts 15836 karma points MVP 13x admin c-trib
    Oct 30, 2014 @ 12:42
    Lee Kelleher
    0

    No, no - didn't mean to scare monger ;-) I was genuinely curious.

    I haven't tried the Grid in the beta yet (I last tried it a few weeks ago) ... but it struck me that the Grid was intended to be a "full width" property-editor, whereas using it with Vorto would make it nested. Guess I'm more curious about the UI/UX of it.

    Cool that it works thought! Good stuff.

    Cheers,
    - Lee

  • Søren Kottal 712 posts 4570 karma points MVP 6x c-trib
    Oct 30, 2014 @ 13:07
    Søren Kottal
    2

    I am using the grid to populate the content part of a layout similar to this.

     

     

    If you clone the git repository, you get an option to hide the label of the Vorto field, so you still have a full width property editor.

     

     

     

    Then you have to handle the possibility of not having all language versions filled. I did this in my template:

                        @if (Model.Content.HasVortoValue("content"))
                        {
                            @Html.Partial("Grid/bootstrap3", Model.Content.GetVortoValue("content"))
                        }
                        else {
                            if (Model.Content.HasVortoValue("content","da-DK"))
                            {
                                @Html.Partial("Grid/bootstrap3", Model.Content.GetVortoValue("content","da-DK"))
                            }
                        }

     

     That way, it reverts to danish (if a danish version exists)

     

     

     

  • Ranjit J. Vaity 66 posts 109 karma points
    Jan 25, 2018 @ 18:21
    Ranjit J. Vaity
    0

    Hello Søren / Lee,

    I am trying to make this work LeBlender in Vorto. I tried all above suggestions but no luck.

    I added Skybrud.Umbraco.GridData as well.

    I am posting my snippet here for some input and suggestions.

    my controller

    vm.TextPageGridModel = GridDataModel.Deserialize(model.Content.GetVortoValue<string>("vortoGrid"));
    

    My razor View

    @Html.Partial("Grid/bootstrap3", Model.TextPageGridModel)
    

    Not YSOD but I get this error

    'Lecoati.LeBlender.Extension.Models.LeBlenderModel' does not contain a definition for 'guid'

    Any help much appriciated! Thank you in advance.

    Ranjit J. Vaity

  • Ranjit J. Vaity 66 posts 109 karma points
    Feb 01, 2018 @ 06:33
    Ranjit J. Vaity
    0

    Hello Community,

    My issue resolved. It not much of a big change but I had to bring all code from Controller to view. Following is the snippet.

        @using Our.Umbraco.Vorto.Extensions
        @using CapgeminiSogeti.BM.Core.Models.ViewModels
        @using Skybrud.Umbraco.GridData
        @inherits Umbraco.Web.Mvc.UmbracoViewPage<TextPageViewModel>
    
    @{
        Layout = "MasterLayout.cshtml";
        string vortoGridJson = Model.Content.GetVortoValue<string>("vortoGrid");
        }
    
    <section class="page-content container">
            @Html.Partial("Grid/bootstrap3", GridDataModel.Deserialize(vortoGridJson))
        </section>
    

    Thank you!

    Ranjit J. Vaity

  • Artem 6 posts 77 karma points
    Oct 30, 2018 @ 15:13
    Artem
    0

    Hi. Also we can use Vorto like property editor in LeBlender component with two simple changes to the source files. Unfortunately those packages do not work together from the box.

    Changes into LeBlender ~\App_Plugins\LeBlender\editors\leblendereditor\dialogs\parameterconfig.controller.js

    enter image description here

    Changes into Vorto

    ~\App_Plugins\Vorto\js\vorto.js

    enter image description here

    That’s all )

    Now you can use Vorto like property editor in LeBlender component

    enter image description here

Please Sign in or register to post replies

Write your reply to:

Draft