Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

selector (resource resolution) not working

Avatar

Level 9

I have a page that uses this page template (sling:resourceType = /apps/mysite/components/page/content-page)

 

to test selectors (which I have not done before), I created a copy of /apps/mysite/components/page/content-page/content-page.html and called it /apps/mysite/components/page/content-page/content-page.test.html. The contents of the 2 files are the same EXCEPT I added a "hello there" text on the test.html version.

 

When viewing the page via view-as-published with the selector (example: http://localhost:4502/content/mysite/en/animals/frogs.test.html?wcmmode=disabled), I do not see the "hello there" text. What am I missing?

 

Thank you.

 

 

 

 

<!DOCTYPE HTML>
<html data-sly-use.page="com.adobe.cq.wcm.core.components.models.Page" lang="${page.language}"
      data-sly-use.head="head.html"
      data-sly-use.footer="footer.html"
      data-sly-use.redirect="redirect.html">
    <head data-sly-call="${head.head @ page = page}"></head>
    <body>
        <h1>hello there</h1>
        <sly data-sly-test.isRedirectPage="${page.redirectTarget && (wcmmode.edit || wcmmode.preview)}"
             data-sly-call="${redirect.redirect @ redirectTarget = page.redirectTarget}"></sly>
        <!-- always include the rest of the page -->
            <sly data-sly-include="body.socialmedia_begin.html"></sly>
            <sly data-sly-include="body.html"></sly>
            <!--<sly data-sly-call="${footer.footer @ page = page}"></sly>-->
            <sly data-sly-include="body.socialmedia_end.html"></sly>
    </body>
</html>

 

 

 

 

 

 

 

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi @jayv25585659, instead of

/apps/flinders/components/page/content-page/content-page.test.html

try to use

/apps/flinders/components/page/content-page/test.html

In general if you are creating separate renderer for specific selector you should use only selector name as *.html or *.jsp file name.

View solution in original post

2 Replies

Avatar

Correct answer by
Community Advisor

Hi @jayv25585659, instead of

/apps/flinders/components/page/content-page/content-page.test.html

try to use

/apps/flinders/components/page/content-page/test.html

In general if you are creating separate renderer for specific selector you should use only selector name as *.html or *.jsp file name.