Forum Discussion
1 Reply
- AdamN14 years agoKhoros Oracle
Over time as custom content areas have become more powerful (ie. support for script, freemarker), the line between custom content and custom components has definitely blurred a bit. That said, there are still some advantages and disadvantages for each.
Because custom content areas can be updated via the admin (after being placed via Studio), they're best used for things that may change on a regular basis. For example, announcements, promos, or other messaging that is time sensitive. The other important thing to note about custom content areas, is that the content must be manually added in production. Only the placement is saved in Studio, and thus the content cannot be pushed to produciton via a Studio push.
Custom components are best for things that you will not need to update as frequently. For example, a custom component to show the 5 most recent unanswered threads will likely not need to be changed very often since you can automatically populate the component with recent content via the REST API. Another nice thing about custom components is that they can be saved in Studio. This has two benefits: 1. changes are versioned, so if you make a mistake you can revert your changes. 2. your changes can be pushed to production via the normal Studio push workflow.
It's even possible to have a hybrid approach incorporating both custom content and custom components. This can be useful with custom components in which you want to display "hand-picked" content. Let's say for example that you have a custom component where you feature three users each week chosen by your community management team. You could use a custom content area to specify the three user id (ie. as a comma-separated value list). Your custom component could then read in these values and display the necessary information about each user.
With this hybrid approach, you have direct control over what's being shown in the custom component, without having to "hardwire" any values into the custom component. This means that you don't have to do a Studio push each time you want to update which users to show. The changes in production take effect immediately. This also makes it easier for a community manager (or other member of the community team) to update the values, since they don't have to worry about touching the code for the custom component.
I hope this helps!
Related Content
- 23 days ago
- 23 days ago
- 23 days ago
- 23 days ago
- 23 days ago