cancel
Showing results for 
Search instead for 
Did you mean: 

Navigation Node Entries dynamically generated by solr result

serdar_dere_cs
Explorer
0 Kudos

Hello there,

I have Products which have two Information I index in my solr.

Brand and Lines.

When I index my products, they all contain these information.

Now I want dynamic Navigation bar, which looks like following

Products

-> List of Brands

---> List of Lines for each brand

And this should dynamically generated at login from solr search result.

Actually I am lost here how to begin with, Does it make sense to generate a new CMSComponent of Type AbstractCMSComponent?

Cheers

- Serdar

Accepted Solutions (0)

Answers (1)

Answers (1)

alemasetto
Participant
0 Kudos

My understanding is that you're using accelerator storefront. I recommend that you create a new CMS component that extends AbstractCMSComponent (of course if you are not using the Composable Strorefront). This component will have its own controller and jsp. In the logic implemented in the controller you will be able to handle the search, filtering of results, etc..

Do not create navigation nodes nor entries, just pass the model to the view and delegate the jsp to render the HTML code.

Some best practices https://help.sap.com/docs/SAP_COMMERCE_CLOUD_PUBLIC_CLOUD/51e73d14aedc487384e4518b60a1f5fd/06250f8bb...

serdar_dere_cs
Explorer
0 Kudos

Hi Alessandro,

I actually am using Composable Storefront 6.0 (Spartacus) and got rid of any JSP components which were part of the spartacus sampledata.

I current idea was to create a Controller which returns a ListAdaptedComponents.

In the Controller, I would make a solr.search query where I get all brands, and go through all the results and search for the lines.

But maybe this is a bad idea.

adambadura
Participant
0 Kudos

Hi there,

We had a similar requirement and we ended up developing custom OCC resource that generates a response containing the product catalog menu structure based on certain product attributes indexed in SOLR. On the frontend side we also needed to develop custom navigation component that uses the OCC endpoint and builds a product navigation menu based on the response.