One Resource to multiple view mapping | Community
Skip to main content
New Participant
April 25, 2016
Solved

One Resource to multiple view mapping

  • April 25, 2016
  • 2 replies
  • 1318 views

Hey All,

Is it possible for Sling to map one resource to multiple views. Say I have a component @ /apps/<site>/components/breadcrumb and this has multiple views under /etc/1/components/breadcrumb/view.jsp and  /etc/2/components/breadcrumb/view.jsp, I want Sling to check if view is present in /etc/2 hierarchy then pick that one else pick the one in etc/1 hierarchy . Is it possible to implement this with current Sling Resource Resolver ?

Regards

Shivika

shivisaggi@gmail.com

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 Tuhin_Ghosh

Hi Shivika,

Read about selectors which should ideally solve your problem. Some articles are given below for your reference.

http://blogs.adobe.com/contentmanagement/tag/selectors/

https://docs.adobe.com/docs/v5_1/html-resources/cq5_guide_developer/ch02s08.html

http://www.citytechinc.com/us/en/blog/2013/08/apache-sling-selectors-request-parameters.html

 

Regards

Tuhin

2 replies

Tuhin_Ghosh
Tuhin_GhoshAccepted solution
New Participant
April 28, 2016
mkumar
New Participant
April 25, 2016

Similar functionality can be achieved through using the selectors in the request url. You can have multiple views/jsp according to your design and need in your component level.

Refer the below url for more information on selectors.

https://docs.adobe.com/docs/en/aem/6-1/develop/the-basics.html#Locating the script