Assistance with Dynamic Display of Language Preferences in User Profiles

Hello Wix Support/Community,

I’m currently working on a feature for my Wix site where I aim to dynamically display language preferences on user profiles. My goal is to show up to 5 groups of language preferences, each consisting of a language and its proficiency level, directly fetched from the Register collection. Each group should display a language icon, the language name, and the proficiency level. These preferences are editable on a separate profile editing page, but on the profile page, they should be read-only.

Here’s the structure of my collections:

  • The Register collection contains user profiles with 10 reference fields: 5 fields (languageId1, languageId2, …, languageId5) reference the Languages collection for chosen languages and their icons, and the other 5 fields (levelId1, levelId2, …, levelId5) reference the LanguageLevels collection for proficiency levels.
  • The Languages collection includes language names and their corresponding icons.
  • The LanguageLevels collection includes descriptions of proficiency levels.

On the user profile page, I’ve set up 5 groups of elements to display the chosen languages and levels. Each group has dropdowns linked to the respective fields in the Register collection for language and level selection. The identifiers for these fields are as follows:

  • For the 1st language group: languageId, levelId
  • For the 2nd language group: languageId2, levelId2
  • And so on up to the 5th group: languageId5, levelId5

The challenge I’m facing is creating a functionality where:

  • Only the filled language groups are displayed on the profile page, arranged consecutively without any gaps.
  • If a language is removed in the editor, its corresponding group on the profile page should also disappear, causing the subsequent filled groups to shift up and fill in the gap.

I have implemented the dropdowns and the save button functionality that updates the Register collection. However, I need guidance on making the display of these language groups dynamic based on their filled status and rearranging them as described.

Could you provide insights or examples on how to achieve this with Wix Code (Velo)? Specifically, I’m looking for a way to dynamically manage the visibility and order of these language groups on the profile page based on the data present in the Register collection.

Thank you for your assistance!

Can you share a screenshot to visualize what you’re looking for?

From what I can see though you can just update the Dropdown options property whenever you need the order or list of languages to change: options - Velo API Reference - Wix.com

1 Like

Look, I have 5 groups of languages that I’ve placed on the user profile and linked each of these elements to its own language field. For example, in the picture, you can see:
field: LanguageName1 (language image + name) field: levelName1 (level name)
field: LanguageName2 (language image + name) field: levelName2 (level name)
field: LanguageName3 (language image + name) field: levelName3 (level name)
field: LanguageName4 (language image + name) field: levelName4 (level name)
field: LanguageName5 (language image + name) field: levelName5 (level name)

I have a page with dropdown lists for these languages where I can delete, add, and update the data of these fields, but there’s one problem! When I delete data from the dropdown list (collection), that language disappears from the profile but leaves behind a void… and I want this void to be automatically filled. This is done so that when a user edits data in their profile by adding or deleting a language, there are no unnecessary gaps between the languages that exist.

I hope you understood me, I will add screenshots to make it easier for you to understand.

Can you share example code that is causing the issue?

I don’t have any code at the moment.
Since none of them worked