Re: Replacing resolver.getResource() with sling:include

2015-02-04 Thread Robert Munteanu
Hi Julian,

On Wed, Feb 4, 2015 at 1:51 PM, Julian Sedding  wrote:
> Hi Robert
>
> You could always do the following:
>
>  resourceType="my/component"/>

That works, thank you!

Robert

>
> Regards
> Julian
>
>
> On Wed, Feb 4, 2015 at 12:47 PM, Robert Munteanu  wrote:
>> Hi,
>>
>> I have a ResourceResolver.getResource call which I would like to replace
>> with a  .
>>
>> What I currently have
>>
>> Resource configResource =
>> resolver.getResource("my/component/config.js.jsp");
>> 
>>
>> What I want to have
>>
>> > resourceType="my/component" replaceSelectors="config" />
>>
>> The problem here is that I need the extension to be set as well ( the
>> original request's extension is set to .html ).
>>
>> A brief test done by creating a resource with sling:resourceType
>> "my/component" at /content/test revealed that
>>
>> - /content/test.config.js returns the right content
>> - /content/test.config.html does not
>>
>> So my questions are:
>>
>> 1. Is there a way I can convince sling:include to include the extension?
>> 2. Is there isn't, is this a valid enhancement request?
>>
>> Thanks,
>>
>> Robert
>>


Re: Replacing resolver.getResource() with sling:include

2015-02-04 Thread Julian Sedding
Hi Robert

You could always do the following:



Regards
Julian


On Wed, Feb 4, 2015 at 12:47 PM, Robert Munteanu  wrote:
> Hi,
>
> I have a ResourceResolver.getResource call which I would like to replace
> with a  .
>
> What I currently have
>
> Resource configResource =
> resolver.getResource("my/component/config.js.jsp");
> 
>
> What I want to have
>
>  resourceType="my/component" replaceSelectors="config" />
>
> The problem here is that I need the extension to be set as well ( the
> original request's extension is set to .html ).
>
> A brief test done by creating a resource with sling:resourceType
> "my/component" at /content/test revealed that
>
> - /content/test.config.js returns the right content
> - /content/test.config.html does not
>
> So my questions are:
>
> 1. Is there a way I can convince sling:include to include the extension?
> 2. Is there isn't, is this a valid enhancement request?
>
> Thanks,
>
> Robert
>


Replacing resolver.getResource() with sling:include

2015-02-04 Thread Robert Munteanu
Hi,

I have a ResourceResolver.getResource call which I would like to replace
with a  .

What I currently have

Resource configResource =
resolver.getResource("my/component/config.js.jsp");


What I want to have



The problem here is that I need the extension to be set as well ( the
original request's extension is set to .html ).

A brief test done by creating a resource with sling:resourceType
"my/component" at /content/test revealed that

- /content/test.config.js returns the right content
- /content/test.config.html does not

So my questions are:

1. Is there a way I can convince sling:include to include the extension?
2. Is there isn't, is this a valid enhancement request?

Thanks,

Robert