Sling - Script resolution | Community
Skip to main content
August 8, 2018
Solved

Sling - Script resolution

  • August 8, 2018
  • 5 replies
  • 2870 views

Hi Team, While going through the sling script resolution, i came up with a point where i need some suggestion/clarification.

My URL :

http://localhost:4506/content/ideawebsite.men.abc.html , here selector is 'men.abc'

Node Name : ideapage

Script files under component ideapage are as below :

men.html.jsp

abc.html.jsp

men.abc.html.jsp

ideapage.jsp

On hit of above URL, men.html.jsp renders.

I want to invoke the file 'men.abc.html.jsp'

Can i have a file name like 'men.abc.html.jsp' (seems invalid to me), but if i want a best match with 'men.abc' + 'html' (Selector + Extension) + jsp, what should be the correct file name?

Thanks,

Vipin Kumar

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 arunpatidar

Hi,

Yes, the file men.abc.html.jsp is not going to render anything.

if you want a match for men.abc it would be men.html.jsp. But if you really wanna render something based on 2 selectors then you need to create a file abc.html (selector2)inside men (selector1)folder.

e.g.

http://localhost:4502/content/AEM63App/en/products/2.men.abc.html?wcmmode=disabled

Thanks

Arun

5 replies

arunpatidar
Community Advisor
arunpatidarCommunity AdvisorAccepted solution
Community Advisor
August 8, 2018

Hi,

Yes, the file men.abc.html.jsp is not going to render anything.

if you want a match for men.abc it would be men.html.jsp. But if you really wanna render something based on 2 selectors then you need to create a file abc.html (selector2)inside men (selector1)folder.

e.g.

http://localhost:4502/content/AEM63App/en/products/2.men.abc.html?wcmmode=disabled

Thanks

Arun

Arun Patidar
August 8, 2018

Thanks Arun for clarifying the doubt. It works.

smacdonald2008
August 8, 2018

Excellent answer Arun!

December 4, 2018

HI ,

Can You please Review my video and Suggest some improvement. Sling Script Resolution - YouTube

Thanks In Advance

December 4, 2018

Hi ,

You can watch the video here Sling Script Resolution - YouTube  In which I have tried explaining how to make use to different script and order of their resolution.

Also Please comment your valuable feedback.