> Portal Navigation: > > - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version. > - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages). > - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`). > - Top-level index of all portals: https://dev.wix.com/docs/llms.txt > - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt # Method name: updateBadgesDisplayOrder(badgeIds: Array) # Method package: wixMembersV2 # Method menu location: wixMembersV2 --> badges --> updateBadgesDisplayOrder # Method Link: https://dev.wix.com/docs/velo/apis/wix-members-v2/badges/update-badges-display-order.md # Method Description: Updates badges' display order. The `badgeId` parameter must be an ID from your site's `Members/Badges` collection. Typically, you retrieve the ID from the collection using a query or through a dataset. This function is not a universal function and runs only on the backend # Method Code Examples: *** Note: do not assume any prop names or enum values other than the ones in the example. ## Updates badge display order. (dashboard page code) ```javascript import { badges } from 'wix-members.v2'; /* Sample badgeIds value: * [ * '215be5d9-4b32-4861-9eb5-2152930dd0b4', * 'aedd9a3d-1efa-45ce-85d6-df09a167e37e', * 'e80fed60-687e-4b91-a24c-252c4b32227b' * ] */ export async function myUpdateBadgesDisplayOrderFunction(badgeIds) { try { const updatedBadgeDisplay = await badges.updateBadgesDisplayOrder(badgeIds); console.log('Updated badge display order: ', updatedBadgeDisplay); return updatedBadgeDisplay; } catch (error) { console.error(error); // Handle the error } } /* Promise resolves to: * { * "badges": [ * { * "_createdDate": "2024-01-18T10:27:14.878Z", * "_id": "215be5d9-4b32-4861-9eb5-2152930dd0b4", * "_updatedDate": "2024-01-18T14:50:36.174Z", * "backgroundColor": "#42A5F5", * "description": "Outstanding Contributor Badge", * "icon": "https://example.com/custom-badge-icon.svg", * "permissionsEnabled": true, * "slug": "super-contributor", * "textColor": "#FFFF00", * "title": "Super Contributor" * }, * { * "_createdDate": "2024-01-18T13:53:11.659Z", * "_id": "aedd9a3d-1efa-45ce-85d6-df09a167e37e", * "_updatedDate": "2024-01-18T13:53:11.659Z", * "backgroundColor": "#796EFF", * "description": "Completed challenging tasks and achieved milestones.", * "icon": "https://static.wixstatic.com/shapes/11062b_30b982c4ceb141d884fa15ecfb07d26c.svg", * "permissionsEnabled": false, * "slug": "achievement-unlocked", * "textColor": "#FFFFFF", * "title": "Achievement Unlocked" * }, * { * "_createdDate": "2024-01-18T13:53:37.067Z", * "_id": "e80fed60-687e-4b91-a24c-252c4b32227b", * "_updatedDate": "2024-01-18T13:53:37.067Z", * "backgroundColor": "#FF5C79", * "description": "Recognized for outstanding community contributions and leadership.", * "icon": "https://static.wixstatic.com/shapes/cb523e8b3f9b4908b85a4a1c577af32b.svg", * "permissionsEnabled": false, * "slug": "community-hero", * "textColor": "#FFFFFF", * "title": "Community Hero" * } * ] * } */ ``` ## Updates badge display order. (export from backend code) ```javascript import { Permissions, webMethod } from 'wix-web-module'; import { badges } from 'wix-members.v2'; import { elevate } from 'wix-auth'; /* Sample badgeIds value: * [ * '215be5d9-4b32-4861-9eb5-2152930dd0b4', * 'aedd9a3d-1efa-45ce-85d6-df09a167e37e', * 'e80fed60-687e-4b91-a24c-252c4b32227b' * ] */ export const myUpdateBadgesDisplayOrderFunction = webMethod(Permissions.Anyone, async (badgeIds) => { try { const elevatedUpdateBadgesDisplayOrder = elevate(badges.updateBadgesDisplayOrder); const updatedBadgeDisplay = await elevatedUpdateBadgesDisplayOrder(badgeIds); console.log('Updated badge display order: ', updatedBadgeDisplay); return updatedBadgeDisplay; } catch (error) { console.error(error); // Handle the error } }); /* Promise resolves to: * { * "badges": [ * { * "_createdDate": "2024-01-18T10:27:14.878Z", * "_id": "215be5d9-4b32-4861-9eb5-2152930dd0b4", * "_updatedDate": "2024-01-18T14:50:36.174Z", * "backgroundColor": "#42A5F5", * "description": "Outstanding Contributor Badge", * "icon": "https://example.com/custom-badge-icon.svg", * "permissionsEnabled": true, * "slug": "super-contributor", * "textColor": "#FFFF00", * "title": "Super Contributor" * }, * { * "_createdDate": "2024-01-18T13:53:11.659Z", * "_id": "aedd9a3d-1efa-45ce-85d6-df09a167e37e", * "_updatedDate": "2024-01-18T13:53:11.659Z", * "backgroundColor": "#796EFF", * "description": "Completed challenging tasks and achieved milestones.", * "icon": "https://static.wixstatic.com/shapes/11062b_30b982c4ceb141d884fa15ecfb07d26c.svg", * "permissionsEnabled": false, * "slug": "achievement-unlocked", * "textColor": "#FFFFFF", * "title": "Achievement Unlocked" * }, * { * "_createdDate": "2024-01-18T13:53:37.067Z", * "_id": "e80fed60-687e-4b91-a24c-252c4b32227b", * "_updatedDate": "2024-01-18T13:53:37.067Z", * "backgroundColor": "#FF5C79", * "description": "Recognized for outstanding community contributions and leadership.", * "icon": "https://static.wixstatic.com/shapes/cb523e8b3f9b4908b85a4a1c577af32b.svg", * "permissionsEnabled": false, * "slug": "community-hero", * "textColor": "#FFFFFF", * "title": "Community Hero" * } * ] * } */ ``` ---