Copied to clipboard

Flag this post as spam?

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


  • trfletch 598 posts 604 karma points
    Apr 08, 2009 @ 13:37
    trfletch
    0

    Related Links link to documents (media) as well as pages

    Hi,

    I have a list on some pages that is populated using the "Related Links" data type but as well as being able to select and display links to Internal and External pages I want to be able to select links to media (such as PDF's or Word Documents). Has anyone done anything like this before or would it be possible to modify the "Related Links" datatype so that as well as being able to select Content Nodes you could select Media Nodes. I would really appreciate if someone could shed any light on this. Cheers

  • Comment author was deleted

    Apr 08, 2009 @ 14:04

    Hi Tony,

    Sure it is possible to modify the related links to also allow links to media items. Take a look at the current sourcecode for the related link and add the functionality you want.

  • trfletch 598 posts 604 karma points
    Apr 08, 2009 @ 14:06
    trfletch
    0

    Hi Tim,

    Thanks for the quick response, where would I find the current source code? I'm not much of a developer myself but if I know where to find the code I might be able to work out what to do. I have searched my umbraco website folder for "related links" but nothing shows up.

  • Comment author was deleted

    Apr 08, 2009 @ 14:24

    You can find the sourcecode on codeplex

    http://www.codeplex.com/umbraco

    It's in the editorcontrols project.

  • trfletch 598 posts 604 karma points
    Apr 08, 2009 @ 14:29
    trfletch
    0

    Hi Tim,

    Once again thank you for the quick response, I will have a look at the source code although I think I'm in way over my head here, when I said I'm not much of a developer I kind of meant I am not a developer at all! I'm suprised someone else hasn't already modified the Related Links data type to allow it to pick Media as well. I thought it would be quick handy if someone wanted to have a list of documents on a page.

  • Comment author was deleted

    Apr 08, 2009 @ 15:42

    Hi Tony,

    Check out http://www.nibble.be/?p=64

    I made a related media datatype

  • trfletch 598 posts 604 karma points
    Apr 08, 2009 @ 15:58
    trfletch
    0

    Hi Tim,

    Thanks for that, that is excellent, is there anyway you know of to make it so that you could have a related links data type that picks Content or Media? So you could have a list of related links that is a combination of webpages (both internal and external) and documents (pdf's etc) or would I have to create an XSLT that combines the original related links datatype and the new media related links datatype you created then sort the results alphabetically? For example you could have an alphabetical list on a page that is a mixture as follows:
    [b]
    Related Links[/b]
    BBC Website this is an external link
    Childrens Section this is an internal link
    Dave's list this is a PDF from Media section
    Freddies website this is an external link
    Gary's website this is an external link

  • Comment author was deleted

    Apr 08, 2009 @ 17:08

    Hi Tony,

    That would need another datatype, a combined one, but the way you outline it with combining the results should also do the trick.

  • trfletch 598 posts 604 karma points
    Apr 08, 2009 @ 17:14
    trfletch
    0

    I have combined the Two XSLT's into one XSLT but I am not sure how I would sort it, I did try putting in above

      but it didn't like that, I have since realised that is of course not nodeName that I want to sort by but I'm not sure what it is I want to sort by or where I would put the sort command in my XSLT, I currently have as follows:


      [code]




      [/code]

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies