Try Now
More in this section

Forums / Project Feather / Access Resource Package Assets from Content Widget

Access Resource Package Assets from Content Widget

3 posts, 0 answered
  1. Mike
    Mike avatar
    4 posts
    24 Oct 2013
    11 Jun 2015
    Link to this post


    I'm wanting to access images within my resource package from the html inside of a content widget on my page. Is this possible? It appears Razor syntax does not get rendered so I cannot use one of these statements:




    I'm hoping I don't have to add these images to the SiteFinity Library just so I can access them.




  2. Matt
    Matt avatar
    6 posts
    21 Aug 2014
    20 Nov 2015
    Link to this post
    I, too, would like to know if this is possible.
  3. Arnob Makhlaqur
    Arnob Makhlaqur avatar
    41 posts
    21 Oct 2016
    20 Nov 2015
    Link to this post
    Hello Mike,

    Images can be accessed from the file location from the HTML inside of a Content widget with the following code:
    <img src="/ResourcePackages/MyResourcePackage/image/whatever.jpg" />

    It is not possible to use the Html Helpers inside the editor of the Content Block as it uses @Html.Raw method to return the content.

    Structure of the MVC Content Block can be found here: https://github.com/Sitefinity/feather-widgets/blob/master/Telerik.Sitefinity.Frontend.ContentBlock/Mvc/Views/ContentBlock/Default.cshtml.

    Arnob Makhlaqur
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Sitefinity CMS Ideas&Feedback Portal and vote to affect the priority of the items
3 posts, 0 answered