Using Variables in HTML files

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Using Variables in HTML files

seannolan
Hi guys,

I'm totally new at this and I'm a front end developer/designer with basically no idea about java or wickets so brace yourself for some stupid questions. Basically, I want my <img src=" to be dynamically generated depending on whether or not the site is local or live. So the problem is when I'm on my local server the address is localhost:8080/sitename when I'm on live its just sitename.com. When I want to reference an image on local i need to reference /sitename/images/ when i want to do it on live i need to reference /images/ which is the way it should be. Is there something in wickets akin to inline php that i can insert like <?php echo $rootdirectory ?>/images/ in my wicket .html files. I'm having major issues with this so any help would be greatly appreciated. I know I can do it by assigning a wicket id to the image and then generating the src in the java file but doing that for every single image in the site would be outrageously time consuming as its an absolutely huge webapp. I'm looking for something that i could access sitewide but i would take any sort of basic implementation of inline java variables in the html. Really desperate here so I'd really really appreciate if someone could tell me how to do this.

Thanks,
Sean.
Reply | Threaded
Open this post in threaded view
|

Re: Using Variables in HTML files

romanasu
i don't think you really want that.
You use the same images on local and on public ? If true, you just put the images in the war, and the path to the image is relative().