Copied to clipboard

Flag this post as spam?

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


  • John Churchley 27 posts 172 karma points
    Mar 19, 2014 @ 15:14
    John Churchley
    0

    Using the MultiNodeTreePicker in V7.0.4

    Does any one know of any documentation on how to access images through Umbraco V7 MNTP?

    Is it now default CSV or XML data storage?

    I've attempted to implement the dynamic examples here but without sucess http://our.umbraco.org/documentation/Using-Umbraco/Backoffice-Overview/Property-Editors/Built-in-Property-Editors/Multi-Node-Tree-Picker

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Mar 19, 2014 @ 16:21
    Jan Skovgaard
    0

    Hi John

    The default storage is XML and as you may have noticed the implementation of the MNTP in v7 is different from the one in other versions. 

    However seems like the current implementation is using CSV to serve the chosen pageid's as a comma-seperated list. So I think you should give the dynamic example using the CSV version a try.

    Does that work?

    /Jan

  • John Churchley 27 posts 172 karma points
    Mar 19, 2014 @ 16:31
    John Churchley
    0
    @{
        var dynamicPublishedMNTPNodeListCSV = CurrentPage.imageSlider.Split(new string[] { "," }, StringSplitOptions.RemoveEmptyEntries);
        var dynamicMNTPCollectionCSV = Umbraco.Content(dynamicPublishedMNTPNodeListCSV);
        foreach (var node in dynamicMNTPCollectionCSV)
        {
            var image = new umbraco.MacroEngines.DynamicNode(node);
            <img src="@image.Url" alt="@image.GetPropertyValue("imageAlt")" />
        }
    }
    

    No Errors but nothing is appearing either.

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Mar 19, 2014 @ 16:56
    Jan Skovgaard
    0

    Hi John

    Hmm, yes I can see that - just tried the same example as well with no luck. I'm not too fluent in Razor so I'm not sure wether or not it's because you and I are missing something or if it may be a bug...

    Hopefully some of the Razor wizards will come to see this post and add their comments as well.

    But perhaps it would be an idea to create an issue at the issue tracker here http://issues.umbraco.org/issues - Then HQ can figure out if it's a bug or not.

    /Jan

  • John Churchley 27 posts 172 karma points
    Mar 19, 2014 @ 17:24
    John Churchley
    101

    Umbraco.Content is never going to work when it's Media!

    @{
        var dynamicPublishedMNTPNodeListCSV = CurrentPage.imageSlider.Split(new string[] { "," }, StringSplitOptions.RemoveEmptyEntries);
        var dynamicMNTPCollectionCSV = Umbraco.Media(dynamicPublishedMNTPNodeListCSV);
        foreach (var image in dynamicMNTPCollectionCSV)
        {
            <img src="@image.Url" alt="@image.GetPropertyValue("imageAlt")" />
        }
    }
    
  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Mar 19, 2014 @ 19:51
    Jan Skovgaard
    0

    Do'h! Of course! I must be doing blind - glad you caught the mistake :)

    /Jan

  • John Churchley 27 posts 172 karma points
    Mar 19, 2014 @ 23:56
    John Churchley
    0

    Thanks Jan!

Please Sign in or register to post replies

Write your reply to:

Draft