1 min read
Part 22: Nested comment for knowledge article
Navigate to knowledge article page and Add container for nested comments section
- Open on knowledge article page from UI Builder.
- From the Content section, After the Container 2.
- Click (+) toadd component to the container.
- In search box, type Container and select Add.
- Keep the default layout
Add Nested comments component to this container
- Click (+) toadd component to the container.
- In search box, type Comments andadd Nested Comments.
Add Data broker to get Knowledge Article Comments
- Create a Data resource
- Click + Add
- Search for keyword “Knowledge”
- From the Server Data section, select Retrieve knowledge comments
- Click Add
- In the configuration section, Fill out the fields below
- Article ID –
@context.props.sysId
- Article ID –
- Observe the JSON on the right side of the screen where it shows the result for the Data broker
- This should be blank for now as we do not have any comments for this article
Update Nested Comments component Configurations
- Update following properties
- Comments :
@data.retrieve_knowledge_comments_1.knowledgeComments
- Actions: Add the following code snippet
- Comments :
[{ "id":"delete", "label":"Delete", "icon":"trash-outline", "ariaLabel":"Delete Comment" }]
Great!! We have successfully added the comments component and hooked it to show article Comments. In the next post, we will hook the event to this component to save the comments.