Dynamically Create Design in Recommendation | Community
Skip to main content
June 27, 2017
Solved

Dynamically Create Design in Recommendation

  • June 27, 2017
  • 2 replies
  • 3364 views

Hi,

Is there a way to make HTML dynamic? I have a requirements to display 50 contents based on Recommendation. But instead of writing it 50 times, is there a way like "loop" to iterate on all recommended content?

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 ParitMittal

Hi ,

You can use Apache Velocity engine to write Templates.Use the open-source Velocity design language to customize recommendation designs.

Information about Velocity can be found at http://velocity.apache.org.

All Velocity logic, syntax, and so on can be used for a recommendation design. This means that you can create for loops, if statements, and other code using Velocity rather than JavaScript

Regards

Parit

2 replies

ParitMittal
ParitMittalAccepted solution
Level 10
June 28, 2017

Hi ,

You can use Apache Velocity engine to write Templates.Use the open-source Velocity design language to customize recommendation designs.

Information about Velocity can be found at http://velocity.apache.org.

All Velocity logic, syntax, and so on can be used for a recommendation design. This means that you can create for loops, if statements, and other code using Velocity rather than JavaScript

Regards

Parit

July 10, 2017

Thanks!

I have a followup question, what if it only returns 3 items, can i add a link that will cover unused tiles?

To give you a background, on page load Recommendation will display 5 tiles per carousel (see attached files).

Sample of Reco with less than 5 reco 

Sample Reco with 5 items