Copied to clipboard

Flag this post as spam?

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


  • Nelson Katende 4 posts 24 karma points
    Dec 03, 2014 @ 00:33
    Nelson Katende
    0

    Videos not showing

    Hi guys. I am using your example

    @using YouTube.Models

    @foreach (var typedVideo in Model.Content.GetPropertyValue<YouTube>("video"))
    {  
        <div>@Html.Raw(typedVideo.Player.EmbedHtml)</div>
        @typedVideo.Snippet.Title<br/>
        @typedVideo.Statistics.ViewCount<br/>
        @typedVideo.Snippet.PublishedAt.Value.ToShortDateString()
    }

     

    But I see this on the page

    [ { "id": "HebhGiTn3W0", "title": "CADDIE B ARIMO FREESTYLE2013 ( OFFICIAL BY SLIMDOGGZ ENTERTAINMENT)" }, { "id": "yZ2dBhlx8Ec", "title": "Carlos Green ft Bruce- Hande (Official HD By Slimdoggz Entertainment)" }, { "id": "XB7eN-UEtws", "title": "Chatzman Bhazi remangoma (BODY SLAM RIDDIM VIDEO BY SLIMDOGZ ENTERTAINMENT)" }, { "id": "-cAh9zMAsSA", "title": "BEENIE VIBES FREESTYLE (Official HD By Slimdoggz Entertainment)" }, { "id": "UVY0_9tf1uw", "title": "Bosslee ft Silent Killer, Master lee &Bongie Dee- bwanji uyu (Official video by Slimdoggz 2011)" }, { "id": "0WzHPW7XWyo", "title": "Bounty Lisa freestyle(Offiacial HD By Slimdoggz Entertainment)" } ]

    My data type name is "YouTube", and document type property is "video", macro "YouTube"

     

    Please help

  • Warren Buckley 2106 posts 4836 karma points MVP 7x admin c-trib
    Dec 03, 2014 @ 09:51
    Warren Buckley
    101

    Hello Nelson, It seem that this is rendering out the RAW JSON for you as opposed to the strongly typed videos.

    Can I check with you what version of Umbraco you are using please?
    Next can I verify that you have put this direct into your .cshtml Razor template for that page rather in a Macro and see if that has any difference/changes for you at all?

    I look forward to hearing back from you.

    Thanks,
    Warren :)

  • Nelson Katende 4 posts 24 karma points
    Dec 04, 2014 @ 00:20
    Nelson Katende
    0

    Hi Warren

     

    Thanks for your help. I was using a macro but I have put it in my Razor template and it works fine.

    Thanks

     

    Nelson

Please Sign in or register to post replies

Write your reply to:

Draft