Martin Strand <do.not.eat.yellow.snow <at> gmail.com> writes:

> Using a <base> different than the current url messes up simple anchor  
> links. I.e. this would result in a new request rather than just scrolling:
> 
> <a href="#top">Top</a>
> 
> I'm sure this doesn't bother everyone but I have lots of those links and  
> that's the reason I don't use <base>

I see. Then I guess we'd need something that is easier to use than Image:

  <img src="../images/foo.gif" t:type="TemplateRelativeResource"/>

Such a TemplateRelativeResource is like the Any component, it will just
output the element it is associated with. But it won't evaluate the
attributes. Instead, it will try to convert a particular attribute 
("src" here) of the element from a relative path to an absolute URL, 
assuming that it is relative to the page template. It should work no 
matter the template is in the context root or on the classpath.

It should have some built-in knowledge:
For <img>, convert the "src" attribute.
For <link>, convert the "href" attribute.
For <a>, convert the "href" attribute.
...

For unforeseen cases, it should take an "attribute" parameter.

There may be an annotation in the page class to indicate that Tapestry
should treat all <img> elements in the page as TemplateRelativeResource.

--
Author of a book for learning Tapestry (http://www.agileskills2.org/EWDT)


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to