Need help : How to work with SCF and handlebars ..? | Community
Skip to main content
New Participant
August 2, 2016
Solved

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

  • August 2, 2016
  • 5 replies
  • 2030 views

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   

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by aponnusa

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

5 replies

JK_Kendall
New Participant
August 3, 2016

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

guna_ksAuthor
New Participant
August 3, 2016

Thanks for your reply Arun, 

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

guna_ksAuthor
New Participant
August 3, 2016

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. 

aponnusaAccepted solution
Employee
August 2, 2016

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

JK_Kendall
New Participant
August 2, 2016

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