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 theLanguages
collection for chosen languages and their icons, and the other 5 fields (levelId1
,levelId2
, …,levelId5
) reference theLanguageLevels
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!