Sounds good. One quick qns- did you have 2 components or one component since you seem to be playing around with resourcetype?
Hey Vkum, We had the exact same problem, two sites, siteA and siteB, where there was a livecopy from siteA to siteB, but siteB had some specific header and footer components and stuff like that. How we solved this is by creating a filter that went over the resources of the request and when we detected that there was a specific implementation of a component for siteB, then we force this supertype. So for example you have /apps/siteA/components/header and /apps/siteB/components/header. If we are in siteB and we see that there is a resourceType on the exact same location as the siteA/components/header for siteB: siteB/components/header, then we replace it: final RequestDispatcherOptions requestDispatcherOptions = new RequestDispatcherOptions(); requestDispatcherOptions.setForceResourceType(siteSpecificResourceType); Greets Roy > On 13 Jul 2016, at 19:02, vkum14 <[hidden > email]</user/SendEmail.jtp?type=node&node=4062530&i=0>> wrote: > > Ohhh now I see what you are saying. Makes sense for simple use cases but here > your breadcrumb is taking the responsibility of figuring out what script to > load. Consider for use cases where in you have to identify script based on > selector, extn etc, you will end up replicating what sling does very well. I > would like to leverage same capability here so if I could tell sling to use > scripts from different set of folders, nothing better than that. > > On Jul 13, 2016 9:23 PM, "Jason Bailey [via Apache Sling]" <[hidden > email]</user/SendEmail.jtp?type=node&node=4062530&i=1> <mailto:[hidden > email]</user/SendEmail.jtp?type=node&node=4062530&i=2>>> wrote: >> >> I've never needed to have the resource resolver select a different script. >> >> Referencing your example of breadcrumb. I've had the main breadcrumb script >> import the specific implementation based on a configuration. >> >> /apps/www/components/breadcrumb/breadcrumb.jsp >> /apps/www/components/breadcrumb/breadcrumb-site1.jsp >> /apps/www/components/breadcrumb/breadcrumb-site2.jsp >> >> The main breadcrumb.jsp is always executed and within that script is the >> logic that determines which version of the breadcrumb we want to provide. At >> that point we pull in the relevant jsp to render the site specific markup. >> >> This keeps all your breadcrumb logic within a single structure. It also adds >> value in the form of being able to offer sites options on how they would >> like their breadcrumbs to look that could be controlled by configuration. >> >> >> >> -----Original Message----- >> From: vkum14 [mailto:[hidden email]] >> Sent: Wednesday, July 13, 2016 10:27 AM >> To: [hidden email] >> Subject: Re: One Resource to multiple views in different locations >> >> Hi Jason, >> >> I believe you are talking about css/js here while my use case is to have >> even different markups for the same component based on the site, it is being >> rendered. IMO, this is a typical use case of telling servletresourceresolver >> to pick different scripts based on the site input. Have you done some sorts >> of that? >> >> >> >> -- >> View this message in context: >> http://apache-sling.73963.n3.nabble.com/One-Resource-to-multiple-views-in-different-locations-tp4061093p4062511.html >> >> <http://apache-sling.73963.n3.nabble.com/One-Resource-to-multiple-views-in-different-locations-tp4061093p4062511.html> >> Sent from the Sling - Users mailing list archive at Nabble.com >> <http://nabble.com/>. >> >> >> ________________________________ >> If you reply to this email, your message will be added to the discussion >> below: >> http://apache-sling.73963.n3.nabble.com/One-Resource-to-multiple-views-in-different-locations-tp4061093p4062524.html >> >> <http://apache-sling.73963.n3.nabble.com/One-Resource-to-multiple-views-in-different-locations-tp4061093p4062524.html> >> To unsubscribe from One Resource to multiple views in different locations, >> click here. >> NAML > > > > -- > View this message in context: > http://apache-sling.73963.n3.nabble.com/One-Resource-to-multiple-views-in-different-locations-tp4061093p4062529.html > > <http://apache-sling.73963.n3.nabble.com/One-Resource-to-multiple-views-in-different-locations-tp4061093p4062529.html> > Sent from the Sling - Users mailing list archive at Nabble.com > <http://nabble.com/>. ________________________________ If you reply to this email, your message will be added to the discussion below: http://apache-sling.73963.n3.nabble.com/One-Resource-to-multiple-views-in-different-locations-tp4061093p4062530.html To unsubscribe from One Resource to multiple views in different locations, click here<http://apache-sling.73963.n3.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=4061093&code=dmt1bWFyMTRAc2FwaWVudC5jb218NDA2MTA5M3wyNTc5NzAxODA=>. NAML<http://apache-sling.73963.n3.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml> -- View this message in context: http://apache-sling.73963.n3.nabble.com/One-Resource-to-multiple-views-in-different-locations-tp4061093p4062531.html Sent from the Sling - Users mailing list archive at Nabble.com.