Skip to Content Skip to Menu

[SOLVED] Country Flag option?

  • imaaxx
  • imaaxx
  • OFFLINE
  • Posts: 126
  • Thanks: 11
  • Karma: 2
10 years 3 months ago - 10 years 2 months ago #247185 by imaaxx
[SOLVED] Country Flag option? was created by imaaxx
Hello,

Is there a way to have the country flag show up in the members profiles? I did a search in Google and found a very old plugin that seems to do this. However i do not want to use it since it was written in 2009 joomlacode.org/gf/project/cb_profileflags Can anyone recommend something else that does this?

Kind Regards
Last edit: 10 years 2 months ago by krileon.

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48479
  • Thanks: 8282
  • Karma: 1443
10 years 3 months ago #247207 by krileon
Replied by krileon on topic Country Flag option?
You can use a delimiter field with IF substitutions based off your country field then show an image based off the value. Alternative is to create an image per country and have their filename match the field value name then you just need to substitute in the field value as the image src. Example as follows.

Code:
<img src="mysite.com/images/countries/[cb_country].png" />


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in or Create an account to join the conversation.

  • imaaxx
  • imaaxx
  • OFFLINE
  • Posts: 126
  • Thanks: 11
  • Karma: 2
10 years 3 months ago #247303 by imaaxx
Replied by imaaxx on topic Country Flag option?
OK so no plugin for this, can you maybe explain the exact steps to take to achieve this. I need the Dummies version please LOL.

Thanks
Alan

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48479
  • Thanks: 8282
  • Karma: 1443
10 years 3 months ago #247316 by krileon
Replied by krileon on topic Country Flag option?
You need an image per country. You then need to have the name of the images match the values of your country select field. You can then use the above example substitution so it pulls an image with the same value of the users field. There's a couple other ways of doing this. For example a database that has countries and the images they belong to then pull the appropriate value with CB Query Field by checking if your country select field has a value in the database. You could also have a bunch of substitution IF statements to check for a country you want an image for then display the image. The above example is the easiest, but it requires strictly named images and field values.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in or Create an account to join the conversation.

  • imaaxx
  • imaaxx
  • OFFLINE
  • Posts: 126
  • Thanks: 11
  • Karma: 2
10 years 3 months ago #247332 by imaaxx
Replied by imaaxx on topic Country Flag option?
OK thanks for the info, i will first attempt to find the images. If i can do that it seems the rest of this is not to bad.

Thanks

Please Log in or Create an account to join the conversation.

  • imaaxx
  • imaaxx
  • OFFLINE
  • Posts: 126
  • Thanks: 11
  • Karma: 2
10 years 3 months ago #247362 by imaaxx
Replied by imaaxx on topic Country Flag option?

krileon wrote: You can use a delimiter field with IF substitutions based off your country field then show an image based off the value. Alternative is to create an image per country and have their filename match the field value name then you just need to substitute in the field value as the image src. Example as follows.

Code:
<img src="mysite.com/images/countries/[cb_country].png" />


And what would the if statement look like? Again sorry but im not a coder so some of this goes over my head.

I have all the images now in my "images" folder under country, but im not sure exactly how to write an if statement and do i do that in a delimiter field?

Sorry for the dumb questions.

Regards

Please Log in or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum