The Group-based Widgets enhancement causes selected widgets to display only for members of specific groups.
If your workplace already has this enhancement, you can find configuration steps on your Styles page.
Sections in this article:
- Considerations
- Set up the enhancement
- Customize the enhancement
- Turn the enhancement on
- Turn the enhancement off
- Use the enhancement
Considerations
- Administrator views: Administrators cannot view published versions of these widgets unless they are in one of the specified groups.
- Deleting and re-adding groups: Deleting and re-adding a group will break existing enhancement functionality for the removed group, because the group ID changes.
- Digital workplace slowness: This enhancement can cause slowness across your digital workplace if you have many groups. Limit use to a maximum of eight groups.
- Group names: Group names cannot start with a number.
- Widget Tabs enhancement: Do not use with widgets that are also using the Widget Tabs enhancement.
Set up the enhancement
To set up the enhancement for the first time, follow the steps below. To request this enhancement to be set up in your digital workplace, contact our Igloo team.
Add enhancement code to the site header
Warning
Adding code that contains errors can disrupt the functionality of your digital workplace. Use caution when adding code to this area.
Add the following code to the header of your digital workplace:
<!-- Group-based widgets enhancement begins -->
<script>
var widgetGroupSettings = {
groups: {
className: 'USER_GROUP_ID',
anotherClassName: 'USER_GROUP_ID'
},
allowMultiple: true
}
</script>
<script src="https://igloo-prod.azureedge.net/cmedia/enhancements/groupBasedWidgets/GroupBasedWidgets.js"></script>
<!-- Group-based widgets enhancement ends -->Customize the enhancement
Once the code above has been added, the following code will be in the header of your digital workplace:
<script>
var widgetGroupSettings = {
groups: {
className: 'USER_GROUP_ID',
anotherClassName: 'USER_GROUP_ID'
},
allowMultiple: true
}
</script>
<script src="https://igloo-prod.azureedge.net/cmedia/enhancements/groupBasedWidgets/GroupBasedWidgets.js"></script>Customize the script in the header
Modify the following parameters of the code in the header to customize the enhancement's functionality.
| Parameter | Description |
|---|---|
| className, anotherClassName |
These temporary names should be replaced with a descriptive class name to identify each group. For example, Additionally, insert the GUID of that group, which should see the widget when the page is loaded, in the value area. For example: You may add additional groups by copying and pasting the entire code line. We recommend using no more than eight groups to prevent lag in the digital workplace. This parameter is required. |
Customize when widgets are displayed
Once you have updated the code in the header, you can modify which widgets display on a particular page by group.
- Navigate to the page you want to edit.
- Select
Actions and then Edit.
- Place a widget or select Edit on the widget.
- Configure the widget as needed in the Options tab.
- In the Appearance tab, in Class, enter the class names you defined in the header, followed by
hide, separated by a space. For example,NorthAmericaDept SouthAmericaDept hide. - Select Update.
- Select Publish Page.
Turn the enhancement on
Once the code has been placed, the enhancement is ready to be used. If you have already turned the enhancement off following the steps in the Turn the enhancement off section below, you can remove <!-- before and --> after the middle lines, and save the changes to the header.
Turn the enhancement off
To turn the enhancement off, you can remove the code entirely or add <!-- before and --> after the middle lines, as shown below, and save the changes to the header.
<!-- Group-based widgets enhancement begins -->
<script>
var widgetGroupSettings = {
groups: {
className: 'USER_GROUP_ID',
anotherClassName: 'USER_GROUP_ID'
},
allowMultiple: true
}
</script>
<script src="https://igloo-prod.azureedge.net/cmedia/enhancements/groupBasedWidgets/GroupBasedWidgets.js"></script>
<!-- Group-based widgets enhancement ends -->Changes to:
<!-- Group-based widgets enhancement begins -->
<!-- <script> -->
<!-- var widgetGroupSettings = { -->
<!-- groups: { -->
<!-- className: 'USER_GROUP_ID', -->
<!-- anotherClassName: 'USER_GROUP_ID' -->
<!-- }, -->
<!-- allowMultiple: true -->
<!-- } -->
<!-- </script> -->
<!-- <script src="https://igloo-prod.azureedge.net/cmedia/enhancements/groupBasedWidgets/GroupBasedWidgets.js"></script> -->
<!-- Group-based widgets enhancement ends -->Use the enhancement
Members who belong to a group specified by the enhancement will see specific widgets relevant to their groups.