« Return to Thread: Velocity macro caching?

Velocity macro caching?

by harin :: Rate this Message:

Reply to Author | View in Thread

Hi,

I have an issue where velocity seems to be caching a velocimacro. It could possibly be my template structure which shown below. When pages are loaded, velocity is rendering the wrong primarySection or secondarySection vm (as these exist in other templates).
To me the logic seems fine as it should call the macro which is on the page, but something is obviously going wrong somewhere. Can anyone see any faults which this method?

test.html:
   #macro(primarySection)

   #end

   #macro(secondarySection)

   #end

  #structure("landing")

In a global macro file i have:

  #macro(structure $structureName)
        #block("structures/${structureName}.vm")
  #end

  #macro(block $path)
        #if($path != "")
                #parse("/site/static/blocks/${path}")
        #end
  #end

And a vm which does the layout (landing.vm):
  <div class="yui-gc">
        <div class="yui-u first">
                <div class="yui-gc">
                        ## Left column
                        <div class="yui-u first">
                                #primarySection()
                        </div>
                       
                        ## Middle column
                        <div class="yui-u">
                                #secondarySection()
                        </div>
                </div>
        </div>
       
        ## Right column
    <div class="yui-u">
                #sponsorSidebar($sponsorSidebar)
        </div>
  </div>

My velocity properties:
  runtime.log.logsystem.class=org.apache.velocity.runtime.log.SimpleLog4JLogSystem
  runtime.log.logsystem.log4j.category=velocity
  runtime.log.reference.log.invalid=false
  file.resource.loader.cache=false
  velocimacro.library.autoreload=false
  velocimacro.permissions.allow.inline.to.replace.global=true
  velocimacro.permissions.allow.inline=true

 « Return to Thread: Velocity macro caching?

LightInTheBox - Buy quality products at wholesale price