link translation for images in template
I would like to share this piece of code with You. Maybe it is useful to someone.
It seems like the following way i can resolve a problem, which complicated my site-design for a long time. Now i can design my templates with the correctly from within the modules section, and still have it working, although i include the template in another master template. My solution: link-translation ;) .
What do i mean ?
I have the following files:
inside /public/mastertemplate.htm i include the local template of the module, like:
Now i design the local template /modules/module1/template.htm using the original images in /public/images/images/ using relative links.
However this will NOT work like this in the final incuded page !
My trick is to dynamically re-write parts of the image link directly after loading the template - before showing it:
Maybe there is a more elegant way, but done as shown above is usefull for me right now ;)
Re: link translation for images in template
Thanks for your tip.
I must say I used a similar way for managing this TBS site that may display some pages in both paths "/" and "/fr/".