National Flags - Display user nationality in Discourse

No worries either :wink: How about just adding the flag as an additional column on the existing user list, sortable like all the other columns? Would that fit your criteria re leveraging existing functionality? :grinning:

Perhaps something like this?

The user list is oriented more towards activity than demographics.

Maybe a model for you would be cakeday.

https://meta.discourse.org/cakeday/anniversaries/today

Or the groups page, which could benefit from demographic info about the people in the group. I for one would be interested to know who in the groups I am in are nearby or where they are. Maybe not on meta but in my community.

https://meta.discourse.org/groups/plugin_authors

Don’t worry about it - I updated my post.

This is off topic - let’s wrap up this side conversation. I will send you a PM. :slight_smile:

Thanks for your input. Unfortunately, none of those really wok for my use case (and I suppose neither for @Andy_Cleff ). I am investigating if we can move a patient group from phpBB to Discourse. The patients often want to get in contact with other patients living in the same country (perhaps for setting up local conferences etc.). So what I would basically need is some kind of directory, where the patients (only user name, no further details) are listed along with their country, and perhaps some configurable custom use fields to go along with it.

Wordpress for example has standard functionality that will fulfills this need. I guess in the Discourse status quo we are probably talking about a custom plugin at this stage. @ebs, I would want to integrate your flag functionality though. Would you be interested in increasing the scope of your plugin on a paid basis, or should we fork your plugin, or should we extend it and submit a PR?

In my community, we have a member directory in wordpress. Details are updated in discourse via API so they are kept in sync. This works reasonably well, but doesn’t allow members to quickly contact each other based on their location.

It would be neat to see this in discourse, and you’re right that it seems to be heading down the path of a custom plugin.

Have you looked at the locations plugin? appears to be more about topics than users, but still perhaps something you can get involved in to add in the ability to plot and see users on a map based on their location field.

1 Like

Hello @Ebs , possible due to hardcoded path below the pictures do not appear in the environment located in folder (/forum) instead of root (/). Is there any way to fix it without nginx proxy?

I’ve just released a modifed version of this which includes the latest up-to-date plugin + @abrambailey’s modifications + support for the Locations Plugin user field. Would be good to get this merged in. https://github.com/davisonio/discourse-nationalflags

Edit: Ok it doesn’t work lol…if anyone knows what’s up let me know

2 Likes

This happens on mobile:

Using latest plugin and Discourse versions

1 Like

go to admin settings customize click on mobile and add for quick fix

.nationalflag-post {
    width: 24px !important;
    height:18px !important ;
    vertical-align: top;
}
3 Likes

Yep, it’s fixed :+1:

Really great to see the improvements made here, everyone.
Really awesome!

Click on mobile? Where is this again?

You’re close! Click Edit CSS/HTML, editing the mobile styling is one of the tabs in there.

4 Likes

Jeff Thanks for updating did you find it Dylan?

Is it possible to use that plugin with other images except flags?

Solution: It is possible to edit flaglist.js.es6 file

{
      "name": "fo",
      "value": "fo.png"
    }

How you can add string variables? What is the user-inputted location?

Solution: I forked plugin repo and customize for my purpose. It seems work.

With that fix, the flag is displayed to the left of the user’s name. How do I move it to the right of the name?

2 Likes

I was added “url” to that component in flaglist.js.es6 file:

{
      "name": "name",
      "value": "name.png",
      "url": "name-link"
    }

How can I print the URL value in show-user-card.hbs?

{{model.custom_fields.nationalflag_iso.url}}

Nice plugin indeed!

I have problem, when i go to user options, and select flag…click SAVE, when i refresh it wont save it it goes back to default.

Any clue why? :slight_smile:

p.s. i did full system and discourse backup this morning, could that be the problem?

Thanks