How to determine whether a Page is an AEM Page or Non-AEM page | Community
Skip to main content
October 2, 2018

How to determine whether a Page is an AEM Page or Non-AEM page

  • October 2, 2018
  • 4 replies
  • 9662 views

Hi,

I have AEM angular JS Single Page application. is there any way to determine in the aem code whether the page is AEM page or Angular page.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

4 replies

arunpatidar
Community Advisor
Community Advisor
October 2, 2018

Hi,

In AEM page is created using template, you can check for template used to create page.

Based on template you can identify if the page is created using page template or It is just HTML snippet or snippet created using other template.

Arun Patidar
October 2, 2018

Hi,

May be i should elaborate more on the issue.

My homepage is: https://mysite.com/gb/en/           -        This page is in AEM.

There is a link on my homepage when clicked it goes to https://mysite.com/gb/en/my-link    -   This is not AEM page. It does not exists on AEM but created by angular JS but it gets the title, description, resourceType and template from the https://mysite.com/gb/en/   i.e. Homepage.

Now, i have a requirement to update the title and description of pages like https://mysite.com/gb/en/my-link  which are not existing on AEM

But I am unable to figure out how to do that. How to identify if  https://mysite.com/gb/en/my-link is a non-AEM page or not.

arunpatidar
Community Advisor
Community Advisor
October 2, 2018

Hi,

you need to check and identify something which make difference between AEM and non AEM page.

As you said:

There is a link on my homepage when clicked it goes to https://mysite.com/gb/en/my-link    -   This is not AEM page. It does not exists on AEM but created by angular JS but it gets the title, description, resourceType and template from the https://mysite.com/gb/en/   i.e. Homepage.

How does it do, are you using kind of SPA architecture, where only content changed but page remains same. Or you are setting all those property via code.

Arun Patidar
October 2, 2018

Yes, This is a SPA architecture

raj_mandalapu
Level 7
October 3, 2018

currently angular JS does some funny stuff and it updates the meta info (e.g. title and description) and title of the page(https://mysite.com/gb/en/my-link )

From where are you getting title and description to update angular pages?

Approach 1 :

If you have so many pages to update then you need to write a script which traverses all anchor links and check whether the page is AEM page or not. by checking sling:resourceType and generate a report in the excel form, the excel will help you to quickly identify AEM page or not

Approach 2:

If the pages are less then you can write a servlet which takes page path as a parameter and returns non AEM anchor links by performing the same above resourceType business logic.

Approach 3:

Check, If angular pages are logically segregated or not, if segregated then you dont need to perform above logic you can directly go an update.

smacdonald2008
Level 10
October 3, 2018

Great community input on this thread!

October 4, 2018

Hi Guys,

Thanks to everyone for your valuable inputs. Awesome Community!!!