sitefinitysitefinity-10

Get blog post URL set in options


In a Sitefinity blog post there is an option to set the desired URL.

In my MVC view I need to grab just that string, not the entire details URL set with HyperLinkHelpers.GetDetailPageUrl, but that information doesn't appear to be readily available on the ItemViewModel class object.


Solution

  • item.DataItem should give you access to the BlogPost object where you can get the UrlName property.

    But better parse the result of the GetDetailPageUrl I think.