Hi Andrew,

Your use-case is exactly what Wicket is about. In the template file, use 
wicket:id attributes on the img tag. Place these tags in some kind of 
container (span or div element) to be able to repeat it. In the code you 
can attach an instance of Image (or variations, see javadoc). Use a 
ListView or Repeater to repeat the images.

You can find more information in the javadocs and on the Wiki. In 
particular
http://cwiki.apache.org/WICKET/newuserguide.html, 
http://cwiki.apache.org/WICKET/listview-and-other-repeaters.html and 
http://cwiki.apache.org/WICKET/how-to-load-an-external-image.html.

Regards,
     Erik


Andrew Moore wrote:
> Hi,
> I'm currently writing a CMS in wicket. One of the things I'm wanting to do
> is make it nice and flexible to be able to design new templates for
> rendering the page.
>
> I'm looking at producing an image gallery at the moment.
>
> For the moment I'm using  dummy.jpg  or something similar in the html files,
> which is fine.
>
> image1 would then be replaced by a Static Image of something like
> "/images/gallery/realImage1.jpg" or whatever..
>
> The problem is, I'm wanting to be able to make it as flexible as possible
> for the designers to be able to use what they want re javascript and markup
> to get the page how they want it.
>
> So for example, instead of referencing "/images/gallery/realImage1.jpg" via
> the wicket:id of an img tag, the value may want to be put into other parts
> of the html markup:
> e.g. 
> # 
> or
>
>
> or anything else really!
>
> So is there anyway this could be done?
> Maybe there is a way to process the HTML and replace data, so for exmaple I
> could have something like:
>
> $image1$ 
> # 
>
>
> and replace $image1$ with '/images/gallery/realImage1.jpg' while rendering
> the page.
>
> Anyone any suggestions?
> Thanks
> Andrew
>
>   

-- 
Erik van Oosten
http://www.day-to-day-stuff.blogspot.com/


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to