solved How do I make a chained menu to toggle images ?

alt=
duke
@musamensa
7 years ago
253 posts
Hi @paul thanks for your the help I often wonder how you guys find the time for development when people like me are always posting in the support forum.

I have a countries and cities chained menu and i would like for a flag to be displayed when a country is selected
updated by @musamensa: 04/25/17 07:56:00AM
paul
@paul
7 years ago
4,326 posts
Is this in the form itself, or on the profile page where the entered location fields are displayed?


--
Paul Asher - JR Developer and System Import Specialist
alt=
duke
@musamensa
7 years ago
253 posts
On the display page
paul
@paul
7 years ago
4,326 posts
OK - In the template you'll need to extrapolate the flag file name from the selected country name and use that to display the flag image. Ideally you'll have a skin folder under the img folder with all the flag images in. Each flag file would be named 'Austria.png', 'Belgium.png', 'Bulgaria.png' etc. The countries would match the options in the chained select field, so then you could add this code to the template to show the flag -

<img src="{$jamroom_url}/skins/{$_conf.jrCore_active_skin}/img/flags/{$profile_hometown_0}.png" alt="{$profile_hometown_0}" title="{$profile_hometown_0}">

If your flag filenames don't match the country names directly, you'll need to do some cross-referencing in the template prior to the above call.
hth


--
Paul Asher - JR Developer and System Import Specialist
alt=
duke
@musamensa
7 years ago
253 posts
Thanks @Paul I will give it a shot
alt=
duke
@musamensa
7 years ago
253 posts
Thanks @paul worked like a charm.
paul
@paul
7 years ago
4,326 posts
That's good - Tagging this thread as solved.


--
Paul Asher - JR Developer and System Import Specialist

Tags