What is it?
An extension of the nested asset listing functionality which allows users of your website to comment and rate content. Useful for things like blogs, article reviews, etc.
Assets used: Asset Builder, Asset Listing, Paint Layout
Below is an overview of how the components work together;
How do I do it?
Configure the asset listing
- Make an asset listing and give it an appropriate name
- Acquire the locks and from the Asset Types to List drop down select Comment
- Select Live from the Asset Statuses to List (TIP: You can speed up your asset listings by specifying asset statuses to list. This is also a good area to double check if comments aren't being displayed as you expected.)
- Select the Root Node. For this example you need to select the area of the tree that the dynamic listing will be used under, so the site asset for your website is a good location. (TIP: You can use more than one root node and reuse the comment listing asset across several sites. You will only see content that is directly under the page the user is currently viewing)
- Set Direct Links only to Yes. This will prevent the listing from looking at anything other than the children of the page you are viewing
- Leave the Customise No Results Bodycopy set to Yes. This will allow you to set a different message to encourage people to comment on the asset if there are none
- Change the Parameter to Replacement Root node for the listing (must be a child of the static root node) and change the Source to Current Asset
- Click the Commit button
Create an Asset Builder
- Create a new Asset Builder and give it an appropriate name
- Acquire the locks and change the Asset Types to Create to Comment
- Leave the create status as Under Construction, it might be a good idea to approve the comments before they go live to stop any naughty messages from being posted
- If you have created a Metadata Schema for these assets you should apply that now however it is not necessary
- Leave Ignore Permissions set to Yes
- Commit your changes then navigate to the Create Location screen via the dropdown in the top right corner
- Change the Additional Location Data Sources Parameter to Additional Create Locations and set Source to Current Asset. This forces the comments to be created as children of the asset the Comment Builder is located on not under the builder itself
- Change the Default Link Type to Type 2 which will prevent comments from appearing in any navigation menus
- Set the Permitted Tree Locations to where you want the comments to be made. Just like the asset listing these should be set as high as you need them and can include several different sites for reuse.
- Under Permitted Asset Types set the different types that you think the comments will be created under. Normally these are Standard Pages, News Items or Calendar type assets are the best
Create a Paint Layout
- Create a new Paint Layout and give it an appropriate name
- Acquire the locks and select the same types that you set in step 10 for the Asset Builder
- Expand the Paint Layout and then expand the Type Formats folder to access the contents for the different types of assets
- Right click on the Default Format if all the assets will display in the same way or pick one of the types and select Edit Contents
- Acquire the locks and create a new div above or below the div with depending on where you would like the comments information to display. The asset contents keyword will print the regular page contents for the current asset the user is viewing
- Select Raw HTML and set the content type to Nest Content
- Nest in the Asset Builder that creates the comments
You can go back and change the No Results body copy for the asset listing to display a message encouraging people to leave the first comment and you can also customise the Asset Builder create form if you so choose.