Forum Discussion

nickb777's avatar
12 years ago

Community front page custom category / board display

Hi All,

 

I'm looking to customise our community front page and I'd like to clean-up / re-style the way the community board list displays.

 

My current approach is to use a custom component using the following skeleton logic:

 

<#list rest("/categories").categories.category as category>
	<h2>${category.title}</h2>
  <#assign boards = rest(category.@href + "/boards?restapi.response_style=view").boards.board />
  <#list boards as board>
	<a href="${board.@view_href}">
		<h3>${board.title}</h3>
		<p>${board.description}</p>
	</a>
  </#list>
</#list>

I'm wondering if this is the correct approach or if there is a more efficient way?

 

I can see this becoming quite server-intensive if the category or board list was to grow or if I was to include additional rest calls for latest messages, number of posts etc.

 

Cheers,

Nick

2 Replies

  • PaoloT's avatar
    PaoloT
    Lithium Alumni (Retired)
    12 years ago

    Hi nickb777 

     

    in general when deciding to replace a standard Lithium widget with a custom component you need to ensure that you can recreate all the features of the standard widget that you need. If this is not possible - then you can consider a simple re-skinning of the standard component.

     

    That said - you are right in taking performance into consideration and trying to minimize the number of rest calls that you will need, especially for components that will live in a busy page (such as the community homepage). Of course it is all related to the metrics of your community and what are your goals etc ... 

     

    Hopes this gives some ideas!

     

  • nickb777's avatar
    nickb777
    Guide
    12 years ago

    Thanks for getting back to me PaoloT.

     

    Please can you explain the basic process of re-skinning a standard component?

     

    I understand that I'd need create a custom component based on the name of the standard component, but I'm not sure what the advantage of doing this vs. creating a separate custom component is.

     

    Does this enable you to utilise the data from the standard component without using REST calls?