Copied to clipboard

Flag this post as spam?

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


  • Sd 12 posts 33 karma points
    Oct 16, 2012 @ 01:39
    Sd
    0

    ublogsy error loading macroengine while showing image in a post.

    Hello, I have installed umbraco v 4.8.1 (Assembly version: 1.0.4609.17579) which is running on www.siddharthkpandey.co.uk with ublogsy 2.1.1.1 which runs fine. But I was going through anthony's video on ublogsy to how to have images in posts, after adding the image property under post info tab for post document type and ublogsyshowpost.cshtml with the code as show in the video, ublogsy doesn't show any posts instead only says: Error loading MacroEngine script (file: /uBlogsy/uBlogsyListPosts.cshtml) and Error loading MacroEngine script (file: /uBlogsy/uBlogsyShowPosts.cshtml). The code below I have taken from the video for ublogsyshowposts.cshtml:

    @helper RenderImage(DynamicNode d)
        {
            //when no image, just return
            if (string.IsNullorEmpty(d.GetPropertyValue("uBlogsyImage"))) { return; }
            //get media item
            var media = new DynamicMedia(d.GetPropertyValue("uBlogsyImage"));
            //get imageGen imageurl and css class
            string imageUrl, cssClass;
            if(Model.NodeTypeAlias == "uBlogsyPost")
            {
                imageUrl = string.format("/ImageGen.ashx?image={0}&width=800", media.Url);
                cssClass = "uBlogsy_image_post";
            }
            else
            {
                imageUrl = string.format("/ImageGen.ashx?image={0}&width=400", media.Url);
                cssClass = "uBlogsy_image_list";
            }
            //render image
            <img src="@imageUrl" class="@cssClass" />
        }

    with @RenderImage(d) calling in the body of ublogsyshowpost.cshtml. 

    Thanks

    Sid

  • Mark Bennett 199 posts 375 karma points
    Oct 16, 2012 @ 12:31
    Mark Bennett
    0

    Sid,

    You need to debug the script and work out what is failing. I normally do this by making the script as simple as possible and then adding bits to it until eventually it works.

    That make sense?

    Mark.

  • Sd 12 posts 33 karma points
    Oct 16, 2012 @ 12:49
    Sd
    0

    Hi Mark, 

    I have debugging the live page by appending ?umbdebug=true, but the page doesn't show anything. I will debug by script again and try to figure out again if I can solve the issue.

    I copied this code as seens in the ublogsy video. 

    Thanks

  • Mark Bennett 199 posts 375 karma points
    Oct 16, 2012 @ 12:58
    Mark Bennett
    0

    Sid,

    So what code did you change in uBlogsyListPosts then ?

    If you remove the calls to the RenderImage helper method do your scripts work again?

    Mark.

  • Sd 12 posts 33 karma points
    Oct 16, 2012 @ 13:22
    Sd
    0

    Mark, while debugging I can see this error:

    Error Loading Razor Script (file: uBlogsy - List Posts) d:\inetpub\vhosts\siddharthkpandey.co.uk\httpdocs\macroScripts\uBlogsy\uBlogsyShowPost.cshtml(122): error CS0117: 'string' does not contain a definition for 'IsNullorEmpty'    at System.Web.Compilation.AssemblyBuilder.Compile()
      at System.Web.Compilation.BuildProvidersCompiler.PerformBuild()
      at System.Web.Compilation.BuildManager.CompileWebFile(VirtualPath virtualPath)
      at System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate)
      at System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate)
      at System.Web.Compilation.BuildManager.GetVirtualPathObjectFactory(VirtualPath virtualPath, HttpContext context, Boolean allowCrossApp, Boolean throwIfNotFound)
      at System.Web.Compilation.BuildManager.CreateInstanceFromVirtualPath(VirtualPath virtualPath, Type requiredBaseType, HttpContext context, Boolean allowCrossApp)
      at System.Web.Compilation.BuildManager.CreateInstanceFromVirtualPath(String virtualPath, Type requiredBaseType)
      at System.Web.WebPages.VirtualPathFactoryManager.CreateInstance[T](String virtualPath)
      at System.Web.WebPages.WebPageExecutingBase.<>c__DisplayClass1.b__0()
      at System.Web.WebPages.Util.EnsureValidPageType(WebPageBase page, String virtualPath)
      at System.Web.WebPages.WebPageBase.<>c__DisplayClass7.b__6(TextWriter writer)
      at System.Web.WebPages.HelperResult.WriteTo(TextWriter writer)
      at System.Web.WebPages.WebPageBase.Write(HelperResult result)
      at ASP._Page_macroScripts_uBlogsy_uBlogsyListPosts_cshtml.Execute() in d:\inetpub\vhosts\siddharthkpandey.co.uk\httpdocs\macroScripts\uBlogsy\uBlogsyListPosts.cshtml:line 74
      at System.Web.WebPages.WebPageBase.ExecutePageHierarchy()
      at System.Web.WebPages.WebPage.ExecutePageHierarchy(IEnumerable`1 executors)
      at System.Web.WebPages.WebPage.ExecutePageHierarchy()
      at System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage)
      at umbraco.MacroEngines.RazorMacroEngine.ExecuteRazor(MacroModel macro, INode currentPage)
      at umbraco.MacroEngines.RazorMacroEngine.Execute(MacroModel macro, INode currentPage)
    
  • Sd 12 posts 33 karma points
    Oct 16, 2012 @ 13:26
    Sd
    1

    Found it. Its a typo mistake - IsNullOrEmpty - with capital O

  • Mark Bennett 199 posts 375 karma points
    Oct 16, 2012 @ 13:29
    Mark Bennett
    0

    Sid,

    Nice one...glad you got it sorted ;)

    Mark..

  • Sd 12 posts 33 karma points
    Oct 16, 2012 @ 13:40
    Sd
    0

    Mark, 

    Everything seems to be fine now but the image is not loading. Instead it is getting a wrong source as http://www.siddharthkpandey.co.uk/ImageGen.ashx?image=/media/9952/earth__americas_.gif&width=400. The id for the image that I have posted is 1293 and name is trial.gif.

     

    Sid

  • Mark Bennett 199 posts 375 karma points
    Oct 16, 2012 @ 13:55
    Mark Bennett
    0

    Sid,

    Did you install imagegen? --> http://www.percipientstudios.com/imagegen/overview.aspx

    Doesn't look like it's configured correctly as navigating to  http://www.siddharthkpandey.co.uk/ImageGen.ashx should give a Hello World.....like this one does here http://www.corefituk.com/ImageGen.ashx

    Mark.

  • Sd 12 posts 33 karma points
    Oct 16, 2012 @ 15:23
    Sd
    0

    Mark, 

    ImageGen is installed. I did it using the umbraco repository and without any errors it was installed successfully. 

    As per your example, you are right, it doesn't show a page with hello world as content.

     

    Sid

  • Mark Bennett 199 posts 375 karma points
    Oct 16, 2012 @ 16:05
    Mark Bennett
    0

    Hi Sid,

    Well we're slowly getting there - might want to check out this post from someone who seemed to have a similar issue ;)

    http://our.umbraco.org/projects/website-utilities/imagegen/imagegen-how-to/29460-No-images-in-ie-on-production-server

    Seems like the ashx file is missing for some reason...

    Mark.

     

  • Sd 12 posts 33 karma points
    Oct 16, 2012 @ 16:45
    Sd
    0

    Mark, 

    Yup the installation has not added the ashx file. Even after uninstalling that and uploading a local copy of the imagegen source has not created the ashx file under root folder. 

    I have tried using the web interface but I can't use ftp at work! :( I will give it a try after going home and will report you if I face any issues. I think just uploading the ashx file should help. 

    Also, thanks a lot Mark. ;)

Please Sign in or register to post replies

Write your reply to:

Draft