Forum Discussion
I think what you want to do is very doable. We've done something very similar with a custom leaderboard widget. We used a community-wide setting to hold a JSON encoded leaderboard object that we deserialize using JavaScript and Freemarker. That may be a bit extreme for you, but you could achieve the same results by having four community-wide settings properties:
customer.events
customer.locations
customer.dates
customer.details
Pick better names, then ask Lithium to set them up for you. Once they're in place, you could create a custom widget with this Freemarker code:
<#assign events = resetadmin("/settings/name/customer.events").value?split("|") /> <#assign dates = restadmin("/settings/name/customer.dates").value?split("|") /> <#assign locations = restadmin("/settings/name/customer.locations").value?split("|") /> <#assign details = restadmin("/settings/name/customer.details").value?split("|") /> <table> <thead> <tr> <th>Date</th> <th>Event</th> <th>Details</th> </tr> </thead> <tbody> <#list events as event> <#assign event_board = restadmin("/boards/id/" + event + "?restapi.response_style=view").board /> <#assign event_href = event_board.@view_href /> <#assign event_title = event_board.title /> <#assign latest_message = restadmin("/boards/id" + event + "/messages/latest?restapi.response_style=view") /> <#assign latest_post = latest_message.message.@view_href /> <#assign latest_post_subj = latest_message.message.subject /> <tr> <td>${dates[event_index]}</td> <td><a href="${event_href}">${event_title}</a> ${locations[event_index]} <br/> Latest Post - <a href="${latest_post}">${latest_post_subj}</a></td> <td><a href="${details[event_index]}" target="_blank">Details >></a></td> </tr> </#list> </tbody> </table>
You would then populate your settings properties with things like:
customer.events => Americas Events|EU Events|AU Events
customer.locations => in Las Vegas|in London|in Sydney
...
This would need to be done by some off-platform script, but you could also built custom widgets within Lithium that admins could use to set these properties.
Related Content
- 11 months ago
- 2 years ago
- 9 months ago
- 2 years ago