Expand my Community achievements bar.

SOLVED

Component not working properly on pages under "/etc/..."

Avatar

Level 2

Hi,

I have created a hotspot component using html5smartimage. This component is working fine on pages under "/content" but it is not working properly for pages under "/etc".

Also I am using imageMap here.

my code is below:

            Image img = new Image(res);

            img.setItemName(Image.PN_REFERENCE, "fileReference");

            img.setSelector("img");

            String mapDefinition = properties.get(Image.PN_IMAGE_MAP, ""); out.println(mapDefinition);

            ImageMap imageMap = ImageMap.fromString(mapDefinition);

            String map = imageMap.draw("someid");

            String src = img.getSrc();

The catch here is that "map" is not getting populated for pages under "/etc" .
Please give your suggestions.

AEM Version: 6.0

Thanks in advance.

1 Accepted Solution

Avatar

Correct answer by
Level 10

Hi,

Is there a reason for creating a page under /etc ? Ideally all the content (pages, images, products etc) should be under /content.

also, is this issue is any instance specific ? Just to understand if there is any access issue.

any more details on that component design would be helpful

View solution in original post

4 Replies

Avatar

Level 10

Are you getting an error in the logs - if so - can you post to give the community more details. A component should be working regardless of where its used. Checking on this issue.

Avatar

Correct answer by
Level 10

Hi,

Is there a reason for creating a page under /etc ? Ideally all the content (pages, images, products etc) should be under /content.

also, is this issue is any instance specific ? Just to understand if there is any access issue.

any more details on that component design would be helpful

Avatar

Level 10

As Lokesh suggests - the best practice using AEM is to create pages following docs:

Creating and Organizing Pages

When you follow the docs - pages are placed under /content. I recommend following best practice as specified in the docs.

Avatar

Employee

You should not create pages under /etc. All pages should exist only under /content.