Copied to clipboard

Flag this post as spam?

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


  • Raymond 4 posts 24 karma points
    Jul 07, 2011 @ 11:45
    Raymond
    0

    Get "Link To Document" from database?

    Hi folks,

    I'm testing out Umbraco to use as a possible alternative to my companies current CMS system and am building some example controls to compare how easy/difficult things will be.

    In one of my controls I'd like to get the URL for published documents I'm pulling from the database and use the URL to display a link to the document along with their details.

    I can get the property data fine but am struggling to find how to get the documents URL as displayed in the back end as "Link To Document".

    Is there an easy way to do this? I've seen the cmsContentXml table has a path in the XML but it's made up of IDs rather than an actual text URL.

    Thanks

    Raymond

     

     

  • Rich Green 2246 posts 4008 karma points
    Jul 07, 2011 @ 11:50
    Rich Green
    0

    Hey Ramond,

    In your usercontrol you should just need to call

     umbraco.library:NiceUrl(nodeid)

    Rich


  • Rich Green 2246 posts 4008 karma points
    Jul 07, 2011 @ 11:53
    Rich Green
    0

    Hey Ramond,

    Just re-read your post, are you trying to read directly from the Umbraco database?

    Maybe I mis-understood, but if so, there's no need, that's what the Umbraco API is for http://our.umbraco.org/wiki/reference/api-cheatsheet

    Rich

  • Raymond 4 posts 24 karma points
    Jul 07, 2011 @ 12:18
    Raymond
    0

    Brilliant thanks Rich, that worked a treat! Hadn't seen the API stuff in my rush to start coding!

    Cheers

    Raymond

  • Rich Green 2246 posts 4008 karma points
    Jul 07, 2011 @ 12:24
    Rich Green
    0

    No problem, let us know if you have anymore questions.

    Might be useful to post what you're looking for in an CMS, or describe what your existing CMS does and people can offer their opinion?

    There's so much that can be achieved in Umbraco with or without writing .NET, but it's great to know that Umbraco can always be extended using .NET if needed.

    Also if you're coming from the .NET world then you're going to love Razor in Umbraco too.

    Best of luck

    Rich 

Please Sign in or register to post replies

Write your reply to:

Draft