Copied to clipboard

Flag this post as spam?

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


  • Kim Rasmussen 81 posts 310 karma points
    Mar 04, 2013 @ 13:09
    Kim Rasmussen
    0

    MNTP with media

    Hi,

    I'am trying to get a list of images with the MNTP. It's likely very easy but I can't find a good example.

    I have created a new datatype of the type Multi-node tree picker (CSV).

    My code so far (not working):

                    @if (Model.HasProperty("photos"))
                    {
                        <div>
                        @foreach (var item in Umbraco.TypedContent(Model.GetPropertyValue("photos").ToString().Split(',')))
                        {
                            <h1>Hey</h1>
                            if (item != null)
                            {
                                <img src="@item.NiceUrl()" alt="@item.Name" />
                            }
                        }
                        </div>
                    }


    Error:

    Compiler Error Message: CS1928: 'Umbraco.Web.Models.RenderModel' indeholder ikke en definition for 'HasProperty', og overload 'Umbraco.Core.PublishedContentExtensions.HasProperty(Umbraco.Core.Models.IPublishedContent, string)' for bedste udvidelsesmetode har ugyldige argumenter 

    Best regards
    Kim

  • Jeroen Breuer 4861 posts 12139 karma points MVP 3x admin c-trib
    Mar 04, 2013 @ 14:05
    Jeroen Breuer
    1

    MNTP with images might be slow if you select a lot of images. You could also try DAMP to select media. You can find an example here: http://24days.in/umbraco/2012/damp-gallery/

    Jeroen

  • Kim Rasmussen 81 posts 310 karma points
    Mar 04, 2013 @ 15:12
    Kim Rasmussen
    0

    Hi Jeroen,

    Thank you for your reply!

    I'am not after a huge amout of pictures - maybe five at most. Is the MNTP that slow? I like that my client is seeing the same interface when picking banners and images - even though DAMP looks very similar!

    Best regards
    Kim

Please Sign in or register to post replies

Write your reply to:

Draft