Expand my Community achievements bar.

Guidelines for the Responsible Use of Generative AI in the Experience Cloud Community.

selector (resource resolution) not working

Avatar

Level 9

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

 

to test selectors (which I have not done before), I created a copy of /apps/flinders/components/page/content-page/content-page.html and called it /apps/flinders/components/page/content-page/content-page.test.html. The contents of the 2 files are the same EXCEPT 2 changes I made:

 

  • I added a "hello there" text on the test.html version.
  • The body tag of the test.html version does not have a CSS class attached to it.

 

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 and the body tag has the classes. 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>
0 Replies