1 Reply Latest reply on Jan 29, 2013 4:39 AM by katrienj

    How to use addSelector

    katrienj Level 1

      Sorry looked around for a solution elsewhere but can nowhere find a working example.

       

      I have a template called "resource". The page test.html is using this template. Now, based on if a user is logged in, or not, I want to add a particular selector to the URL for all pages that use the resource template.

       

      So test.html, needs to become test.loggedin.html, when the user is logged in, and test.anon.html when the user is not logged in. Don't worry about my naming convention, it's just an example.

       

      I expect that I need to add some code in the resource template. But I don't know what. I tried <sling:include addSelectors="loggedin"/> etc, but that's not working.

       

      Any help greatly appreciated.

       

      Cheers.