On Mon, Mar 5, 2018 at 8:42 AM, Robert Munteanu <[email protected]> wrote:
> Hi Ivo,
>
> On Sun, 2018-03-04 at 16:15 -0700, ivoleitao wrote:
> > Then I would like that a customer uses my definition as base but only
> > with a
> > customization on the css and on the logo
> >
> > /apps/acme/img/logo.png
> > /apps/acme/css/acme.css
> >
> > and on content
> >
> > /content/clientacme
>
> The simplest way I see this happening is via a component. Define a
> 'layout' or 'logo' component at /libs/my/component and allow the
> customer to overlay it at /apps/my/component .
>
> Alternatively, you can write another component and lookup the design
> resources using `ResourceResolver.getResource` and a relative path,
> e.g.
>
> resolver.getResource("acme/img/logo.png");
>
> which would first look under /apps and then under /libs.
>
> Thanks,
>
> Robert
>
Something to also keep in mind is that you can define additional search
paths in Apache Sling Resource Resolver Factory. You are not limited to
/apps, and /libs.
You could then have something like /acme or even /apps/acme (I think) as
lookups for resolving relative resources. I would strongly advise against
putting anything in /libs.
Depending on your level of expertise and your exact use case, I would
highly recommend look at using Context Aware Configurations for each tree
where you can specify paths for each context. This is better from a content
delivery standpoint as you could keep your resources all in a similar place
(/content/dam/myLogos) which makes asset and CDN management easier.
Chris