Use picture to indicate each category
Posted: 2005-01-31 12:11:07
I use the template of Twink (xml) and I would like to use a picture to indicate each category.
I transformed the basic code:
<text value="movie.getAttribute('Category') />
to:
<img src="'pics\\cat'+(movie.getAttribute('Category'))+'.gif'"/>
That shows correctly my pictures (if they are well named catX.gif
in the pics folder (where x is the name of Category)).
But the problem is the movies with many categories (e.g. Action / Thriller)
It will be necessary to write a script where the / (or an other character, that doesn't have importance) would be recognized like a separator.
An other soluce (but more complicated, I think) would be to write a sort of database with a valour to each data.
This idea would be applicated to another datas like countries (like I have already write in a precedent post, but less clearly) and for another templates.
Thanks if you try to resolve my problem and if you took time to read this and sorry for the grammatical faults, english isn't my maternel language.
I transformed the basic code:
<text value="movie.getAttribute('Category') />
to:
<img src="'pics\\cat'+(movie.getAttribute('Category'))+'.gif'"/>
That shows correctly my pictures (if they are well named catX.gif
in the pics folder (where x is the name of Category)).
But the problem is the movies with many categories (e.g. Action / Thriller)
It will be necessary to write a script where the / (or an other character, that doesn't have importance) would be recognized like a separator.
An other soluce (but more complicated, I think) would be to write a sort of database with a valour to each data.
This idea would be applicated to another datas like countries (like I have already write in a precedent post, but less clearly) and for another templates.
Thanks if you try to resolve my problem and if you took time to read this and sorry for the grammatical faults, english isn't my maternel language.