Copied to clipboard

Flag this post as spam?

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


  • Mehtab Malik 21 posts 70 karma points
    Jul 22, 2013 @ 12:52
    Mehtab Malik
    0

    umbracoFile property empty

    I manage to successfully upgrade Umbraco from 4.0.3 to 4.11.10. I have 100's of xslt files in the older version and in umbracoSettings.config file I have used  this settting to be "true". Every thing is working except when I wrote a simple razor macro below and noticed @photo.umbracoFile is always null or empty. I found this article http://allan-laustsen.blogspot.co.uk/2012/04/umbraco-razor-dynamicmedia-umbracofile.html but the solution is a bit confusing. I wonder if any one can help on this?

                  
    @{
        //Check the currentpage has a value in the property 'photos'
        if (Model.HasValue("sliderImages"))
        {
    
            var MediaFolder = Library.MediaById(Model.sliderImages);
    
                    <ul>
    
            @foreach (var photo in MediaFolder.Children)
                        {
                         <li>
                                <img src="@photo.umbracoFile" alt="@photo.Name"  />
    
                            </li>
                        }
                    </ul>
    
        }
    }
    
    

  • Jeroen Breuer 4908 posts 12265 karma points MVP 4x admin c-trib
    Jul 23, 2013 @ 12:19
    Jeroen Breuer
    0

    Hello,

    I'm sorry but Razor in Umbraco doesn't work if you have UseLegacyXmlSchema set to true in the umbracoSettings.config file. For now you can only use xslt or set UseLegacyXmlSchema to false and try to convert your XSLT files with this package: http://our.umbraco.org/projects/developer-tools/xsltupdater-for-umbraco

    Jeroen

Please Sign in or register to post replies

Write your reply to:

Draft