There is a relatively easy way of customising the labels used in In Focus web parts; for example swapping out the "External Insights" label and displaying "Announcements" instead, or hiding the date label.
Please note that this customisation does not support multiple languages - users in all languages will see the same custom label.
This can be done through duplicating and then editing a results layout from within the Atlas Configuration workspace.
In this article:
- Copy an existing layout file
- Apply the custom layout to an In Focus web part
- Additional notes
Copy an existing layout file
Open the Atlas Assets library from the left hand menu then open the InFocusResultTypeTemplates folder. Choose the existing .html file for the desired type of content, then duplicate it using the Copy to function in the library and copying to the same folder.
It is important to choose an appropriate layout to start from, as it will include other configuration such as how the thumbnail is determined which differs for Documents vs. External Insights for example.
Right click the new layout file, go to More and click Check out, then right click and Rename the file - we recommend using the new label as part of the filename so it is clear what it is used for.
With the file still checked out you can edit the .html very easily. Click on the file, and a blank "preview" screen should appear. In the top left hand side, click Open then click Open in Text Editor:
Change the content type label
From here you can simply edit one property titled ‘data-label’. Remove the code between the quotes and enter your desired label inside the quotes.
Click Save, close this browser tab, then close the blank "preview" in the previous page to go back to the library. Right click the file, go to More and then Check In the file as a major published version.
Now the results layout file has been created, you need to ensure your In Focus web part is utilising this layout template.
Remove the date
Another common customisation is to remove the date from In Focus results. This is often considered for documents where the date may not really be useful information to the user.
You can remove the date field from a layout file by editing the .html as we did to change the label, but this time removing the code between the quotes in the following line, leaving just the empty quotes:
Apply the custom layout to an In Focus web part
These steps will need to be done for each individual web part where you want the new label, or included as part of a workspace template for ConneX Studio.
Edit the page containing the In Focus web part you want to modify, then edit the web part. Go to the Layout options on the 3rd page of the web part configuration panel. Don't choose the "Custom" result layout for this, instead select the Edit Result Types box below the layout options:
In the External Template URL field on the right, change the URL to your new results template. You'll only need to change the filename at the end of the URL. This is shown in bold below:
If the filename is not valid the field will be highlighted in red as shown below. In this case just double check the filename is correct:
Click Save at the bottom of the panel, then Publish the page with the web part on it. Your results in this web part will now use the new label.
- Custom layouts will not be affected by any upgrades we perform as we only target the expected OOTB templates, so in the future it might be advised to re-copy and re-apply new changes to the OOTB templates to ensure you have the latest features. We are not currently planning any major overhaul to the templates, but this is a consideration for the future.
- Those webparts utilising the new custom template layout can have their configuration exported for reuse, and the .html layout file can be downloaded and saved elsewhere if desired. These methods can be used to ensure that backups exist if needed.
- Embedding these web part configs to workspace templates will ensure these changes are part of your new workspaces automatically. Existing source workspaces without these changes will need to be re-configured and the template updated, so that the change is included in future workspaces created using the template.
Please sign in to leave a comment.