Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

Need help : How to work with SCF and handlebars ..?

Avatar

Level 1

I have created one  component called "leaderboard" which will display the author list depends on No.of Post and No.of.Views  . In this component,i will get a path of any Community page which has a blog component as an input . i have created this component using sightly . But now i want to convert it into  .hbs(handlebar) . Im totally new to handlebars and  SCF . I  dont know where to start with SCF  and how  do i convert this into HBS .

Please do help me or guide me  in this ...!

 

Thanks a lot

Guna   

1 Accepted Solution

Avatar

Correct answer by
Employee

Hi Guna,

As Janice mentioned, we already have SCF Handlebars components that do what you are trying to do. These components could be found at /libs/social/reporting/analytics/components/hbs/communityactivitylist

If you are planning to reuse the component - you might have to do, component markup overlay (extending an existing component).

To write a new SCF component, It can be broken down to these steps

  1. Write Component Factory. This step maps the sling resource type to the Java class that will return values needed by the Handlebars template. Example Link.
  2. Write the Component backend. This step generates the list of Authors based on your business logic.(no of views, and no of posts). Example files needed File 1 & File 2
  3. Write Handlebars .hbs file for the component. Insert your leaderboard markup and use properties exposed by the component in step2. Example Link.

Thanks

View solution in original post

5 Replies

Avatar

Level 9

Hi Guna,

I hope you're using the latest release of AEM Communities.

There are some samples on the Marketing Cloud github repo - such as 

Extend SCF Component example

Here are some doc pages :

Developing Communities :

Last, let me point to the Communities Activity List component that is new in AEM 6.2 and made available for AEM 6.1 as feature pack 4 (FP4).

I hope this helps.

- JK

Avatar

Correct answer by
Employee

Hi Guna,

As Janice mentioned, we already have SCF Handlebars components that do what you are trying to do. These components could be found at /libs/social/reporting/analytics/components/hbs/communityactivitylist

If you are planning to reuse the component - you might have to do, component markup overlay (extending an existing component).

To write a new SCF component, It can be broken down to these steps

  1. Write Component Factory. This step maps the sling resource type to the Java class that will return values needed by the Handlebars template. Example Link.
  2. Write the Component backend. This step generates the list of Authors based on your business logic.(no of views, and no of posts). Example files needed File 1 & File 2
  3. Write Handlebars .hbs file for the component. Insert your leaderboard markup and use properties exposed by the component in step2. Example Link.

Thanks

Avatar

Level 1

Thanks a lot JK, 

Currently I'm using AEM 6.2 , Please do correct me ,if I'm wrong , As far as i know ,all the social community components are integrated with analytics including Community Activity List component. To use that component , first ,i have to configure Analytics right?. Can you please tell me the steps or any links that can help me to configure analytics. In my component ,i have written OSGI service method to get all the details of Blog , the only problem is that i couldn't  get No.of.Views  because that method was configured with analytics . Is there any alternate way to get No.of Views without using Analytics. 

Avatar

Level 1

Thanks for your reply Arun, 

  i will try those steps that you have mentioned and let you know soon . 

Avatar

Level 9

guna ks wrote...

As far as i know ,all the social community components are integrated with analytics including Community Activity List component. To use that component , first ,i have to configure Analytics right?. Can you please tell me the steps or any links that can help me to configure analytics.

 

Yes, Adobe Analytics needs to be licensed and configured.

See Analytics Configuration for Communities Features

- JK