Copied to clipboard

Flag this post as spam?

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


  • Rodske 74 posts 104 karma points
    Feb 21, 2012 @ 12:35
    Rodske
    0

    XPath usage in Media Selection

    Hi all,

    Has anyone attempted trying to automatically knit content and media together by naming convention? I'm thinking a type of "Start node XPath" could do it where it could either evaluate to a folder of specific file. 

    Ideally i'm thinking something like a start xpath like "/descendant::Folder[@nodeName='MediaFolderName']/File[@nodeName=$currentPage/@nodeName]"

    I've also see elsewhere something like ... UmbracoHelper.GetMediaFromXpath("//Folder[@id='" + mediaCompNodeID +"']/competitionsImage") ... but obviously would like things addressed with a nice media context should no direct media be discovered.

    Thoughts? Has anyone else felt the need for speed?

  • Jeroen Breuer 4908 posts 12265 karma points MVP 4x admin c-trib
    Feb 21, 2012 @ 12:42
    Jeroen Breuer
    0

    Do you mean the Xpath start node option in DAMP 2.0? I've used it a couple of times to select a start node. Don't think that it will work with files. The speed should be ok. It can be heavy the first time the xml is generated for the XPath, but it simply uses librery.GetMedia(id, true) which is cached. In this demo I also use the XPath start node somehwere: http://www.youtube.com/watch?v=LkcObL7CMvQ

    Jeroen

Please Sign in or register to post replies

Write your reply to:

Draft