After upgrade to 1.1 -- $macros.image is double pathing!

Last post 10-14-2008 9:06 AM by Jeremy Hodges. 5 replies.
Page 1 of 1 (6 items)
  • After upgrade to 1.1 -- $macros.image is double pathing!

    06-24-2008 11:54 PM

    In the Home.Layout.view file I have the standard header:

     <div id="logo">
         <h1><a href="$urls.Home" title="$data.Site.Title">$macros.Image("i/img02.gif", "%{alt='XXXXX'}")
    </a></h1>
         <h2>$!data.Site.TagLine</h2>
        </div>

    The path to the image is: http://domain/files/themes/[theme]/i/img02.gif.

    What is getting rendered on the page is:  http://domain/files/themes/[theme]/files/themes/[theme]/i/img02.gif.

    This, of course, is wrong.

    In the meantime, I'm going to replicate the image folder down so it still works.  A fix-it tip would be appreciated though!

    Michael


     

  • Re: After upgrade to 1.1 -- $macros.image is double pathing!

    07-11-2008 3:00 PM

    This is still a problem for me and now I see that the reporting graphs are broken due to not finding the information.

     Related, maybe?

  • Re: After upgrade to 1.1 -- $macros.image is double pathing!

    08-26-2008 8:22 PM

    I have also noticed this, and since the fix is to remove the alt text entry, that breaks XHTML validation :(

     

    I have tried every possible way I can think of sneak the alt text item in, such as:

    #set($alttext='blar')

    $macros.Image("i/img02.gif", "%{alt=$alttext'}")

    but to no avail. Any possibility of seeing a patch to fix this, before 2.0?

  • Re: After upgrade to 1.1 -- $macros.image is double pathing!

    08-27-2008 9:45 AM

    This is a bug that was fixed for version 2.0 - there is an easy fix now though. Instead of using the dictionary entry like so:

    $macros.Image("i/img02.gif", "%{alt=$alttext'}")

    Use the string entry like this:

    $macros.Image("i/img02.gif", "alt=$alttext")

    Jayme

  • Re: After upgrade to 1.1 -- $macros.image is double pathing!

    08-27-2008 6:37 PM

    Ah, I should have known it was something simple like that! All the examples I had seen had included the %{} syntax, so I guess I assumed it was required by NVelocity to be input in that format.

     Thanks Jayme.

  • Re: After upgrade to 1.1 -- $macros.image is double pathing!

    10-14-2008 9:06 AM

    You can use the following:

    <img alt="$alttext" src="$macros.ThemeFile("images/page1_title6.jpg")" class="title" />

    Thank you!

    Jeremy Hodges | Windows Server 2003 MCP
    An Unrivaled Managed Hosting Experience: ORCS Web
Page 1 of 1 (6 items)