Copied to clipboard

Flag this post as spam?

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


  • san 30 posts 51 karma points
    Dec 24, 2013 @ 13:52
    san
    0

    Error loading MacroEngine script (file: DisplayPhotos.cshtml)

    Hi,

    i am trying to display images in my gallery.i am getting an error as:

    Galleries

    Error loading MacroEngine script (file: DisplayPhotos.cshtml)

    @{

    //check the currentpage has a value in the property 'photos'
        if (Model.HasValue("photos"))
        {
            var MediaFloder = Library.MediaById(Model.photos);
            <div class="flexslider-container">
                <div class="flexsliders">
                <ul class="slides">
                @foreach (var photo in MediiaFolder.Children)
                    {
                        <li>
                     <img src="@photo.umbracoFile"alt="@photo.Name" />
    

    @photo.Name

    } } }

  • Dennis Aaen 4500 posts 18255 karma points admin hq c-trib
    Dec 24, 2013 @ 15:36
    Dennis Aaen
    0

    Hi chaitanya,

    I have just take a look on your code and I have spotted what I think gives you the error. You have some misspelling the name of your media folder variable and the place where you are called it.(Look at the var = MediaFloder andvar photo inMediiaFolder.Children)

    Try this instead.

       @{
            if(Model.HasValue("photos")){
            var MediaFolder = Library.MediaById(Model.photos);
            <div class="flexslider-container">
                <div class="flexsliders">
                    <ul class="slides">
                        @foreach (var photo in MediaFolder.Children){
                            <li>
                                <img src="@photo.umbracoFile"  alt="@photo.Name"/>
                            </li>
                        }

                    </ul>
                </div>
            </div>

            }
        }

    I just want to make sure that you know that Umbraco 7 comes with MVC set as default rendering engine. The documentation can be found here.

    You can change your Umbraco installation to use Webforms, by change the value in the <defaultRenderingEngine>Mvc</defaultRenderingEngine>  from Mvc to WebForms

     

    Hope this helps you.

    /Dennis

  • Dennis Aaen 4500 posts 18255 karma points admin hq c-trib
    Jan 03, 2014 @ 13:19
    Dennis Aaen
    0

    Hi chaitanya,

    Did you managed to solve your issue with the photo gallery, or did you have time to give my suggestion a try.

    /Dennis

  • san 30 posts 51 karma points
    Jan 03, 2014 @ 13:37
    san
    0

    photo1.jpg

    image not displaying...

Please Sign in or register to post replies

Write your reply to:

Draft