Replace names of countries by a flag

If you made a template for printing or HTML export, you can offer it to the others here. You can also ask here for help about these templates
Post Reply
binoyt
Posts: 8
Joined: 2004-08-30 09:50:43
Location: Liège, Belgium

Replace names of countries by a flag

Post by binoyt »

I use the template "twink", but what I request can apply for others templates. I would like to replace the names of countries by flags.

It would be necessary to include a code to indicate which flag for which text. I have tested something like that, but I don't have enough of knowledge to do it. Can somebody could do it?

Here, an example of flag, like I would for my site: http://games.clanbase.com/fr.gif

Thank you.
antp
Site Admin
Posts: 9630
Joined: 2002-05-30 10:13:07
Location: Brussels
Contact:

Post by antp »

name your gif files with the value that you put in the catalog (e.g. if english movies have "USA" in the Country field, call this flag USA.gif), then instead of $$ITEM_COUNTRY put <img src="$$ITEM_COUNTRY.gif" alt="$$ITEM_COUNTRY"> for example.
binoyt
Posts: 8
Joined: 2004-08-30 09:50:43
Location: Liège, Belgium

Post by binoyt »

It's a good soluce, thanks. But what can I do for international movies ?

For exemple, I have the data "FR/UK" in the field countries, how can I cut it to replace each part in the code?

Here, I put the modified code, adapted to the template "twink":
<img src="'pics\\pays_'+movie.getAttribute('Country')+'.gif'"/>
antp
Site Admin
Posts: 9630
Joined: 2002-05-30 10:13:07
Location: Brussels
Contact:

Post by antp »

I forgot that twink's template was not plain html or php, but xml
Well, that will not be so simple I think :/
Post Reply