Providing query at run time when using List component

Hi All,

I am using List component to get all the content from a folder and filter the list based on a field from the document(using if condition in FTL). I am going through[1], and see that I can pass string(search term) for query(as request parameter) and get results based on this.

I want to provide a string(search term) as request parameter to list component through query param in URL. Can you pls help me give one example how can i do it? Like how can I pass query param value to this list component.

Also, If I can use this query for executing xpath query and one example.

[1] https://documentation.bloomreach.com/library/setup/hst-components/list-component.html

Thanks
Rahul

just hit url with your component and add query to it…e.g.

localhost:8080/site/foo-bar-list-component-url.html?query=your search term

I don’t want to use ‘query’ word as part of query param. Instead I want ‘?docId=1001’. Would it still work?

Thanks
Rahul

that wouldn’t work…you can extend list component and override getSearchQuery method if you want to use other parameter name.