[Zope] Is this possible in Zope?
Richard Jones
rjones@ekit-inc.com
Wed, 9 Jan 2002 17:35:47 +1100
On Wed, 9 Jan 2002 16:08, Michael Fox wrote:
> Hi All,
>
> I'm curious as to wether anyone can provide any input on the following.
>
> I want to render an object's "title" using a series of images.
>
> Assuming I have a collection of images (every letter of the alphabet) and
> each image ID is the same as the letter is represents A, B, C, D etc. Is it
> possible to somehow break-down the "title" property and rendered it as
> such -
>
> +----++---++---++---++---++---++---++---++---++---++---+
>
> | H || E || L || L || O || || W || O || R || L || D |
>
> +----++---++---++---++---++---++---++---++---++---++---+
>
> In an effort to replace <dtml-var title_or_id> ...
>
> Is this possible? Any help appreciated.
A python method with the following code will do it:
s = ''
for c in "hello world":
s = s + '<img src="images/%s.png" alt="%s">'%(c, c)
return s
Where the images folder has images for each of the characters. An extension
of this script would replace the hard-coded "hello world" with an argument.
Richard