How to add query parameters taken from author to url? | Adobe Higher Education
Skip to main content
Ce sujet a été fermé aux réponses.
Meilleure réponse par Saravanan_Dharmaraj

In your sightly html of the component add the below attribute in your component div tag

Am setitng default value as 10. "perpage" is the property you set in dialog

<div class="mycomponent" data-sly-attribute.data-perpage="${ properties.perpage ? properties.perpage : '10' }">
</div>


In your java script , you can read this simple jquery selector

<script>
var perpage = $(".mycomponent").attr("perpage");
//Make a XHR call with perpage value
</script>

1 commentaire

Saravanan_Dharmaraj
Community Advisor
Community Advisor
October 17, 2022

Could you please elaborate more to help?

Manasi29Auteur
Level 3
October 17, 2022

I want to add some query parameters to url dynamically. Need to take it from author through dialog and then pass the accessed values as parameters to url with the help of ajax call and Post methods.

For example:

Number of results to be displayed per page have to be taken from author and passed to url as query parameter.

Saravanan_Dharmaraj
Community Advisor
Community Advisor
October 17, 2022

In your sightly html of the component add the below attribute in your component div tag

Am setitng default value as 10. "perpage" is the property you set in dialog

<div class="mycomponent" data-sly-attribute.data-perpage="${ properties.perpage ? properties.perpage : '10' }">
</div>


In your java script , you can read this simple jquery selector

<script>
var perpage = $(".mycomponent").attr("perpage");
//Make a XHR call with perpage value
</script>