Copied to clipboard

Flag this post as spam?

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


  • blackhawk 313 posts 1368 karma points
    Nov 28, 2017 @ 20:53
    blackhawk
    0

    Using statement for this package

    Is there a using statement we should be referencing in our views when using this package? When I place the following code into my view...

    @inherits Umbraco.Web.Mvc.UmbracoTemplatePage<ContentModels.ContentPage>
    @using ContentModels = Umbraco.Web.PublishedContentModels;
    @using Umbraco.Web;
    @using Umbraco.Web.Models;
    
    
        @{
    
            var membed = Model.Content.GetPropertyValue<List<MvcHtmlString>>("videoEmbed");
    
            <div>
                @membed;
    
            </div>
        }
    

    My web page outputs the following as a string...

      System.Collections.Generic.List`1[System.Web.Mvc.MvcHtmlString];
    

    I'm on Umbraco 7.6.7

  • Dave Woestenborghs 3431 posts 11702 karma points MVP 7x admin c-trib
    Dec 02, 2017 @ 11:04
    Dave Woestenborghs
    1

    Hi Blackhawk,

    I need to update this package it think for better support with models builder.

    Will see if I can put out a new release this week.

    Dave

  • blackhawk 313 posts 1368 karma points
    Dec 02, 2017 @ 13:07
    blackhawk
    0

    Awesome! And thanks for looking into it.

  • Dave Woestenborghs 3431 posts 11702 karma points MVP 7x admin c-trib
    Dec 02, 2017 @ 13:15
    Dave Woestenborghs
    0

    Hi,

    I just released version 3.0.0

    This should fix your problem. Seeing that you are using Modelsbuilder you can use this syntax assuming you are allowing multiple video's to be selected

    @inherits Umbraco.Web.Mvc.UmbracoTemplatePage<ContentModels.ContentPage>
    @using ContentModels = Umbraco.Web.PublishedContentModels;
    @using Umbraco.Web;
    @using Umbraco.Web.Models;
    
    
        @foreach(IHtmlString embed in Model.Content.VideoEmbed) 
    

    {

    @embed

    }

    Dave

  • Dave Woestenborghs 3431 posts 11702 karma points MVP 7x admin c-trib
    Dec 02, 2017 @ 15:01
    Dave Woestenborghs
    2

    Hi Blackhawk,

    I just released v3.0.0 which has better models builder support.

    You can now do this

    @foreach(var embed in Model.Content.VideoEmbed) 
    {
    <div>@embed</div>
    }
    
Please Sign in or register to post replies

Write your reply to:

Draft