Expand my Community achievements bar.

SOLVED

Phonegap Issue

Avatar

Level 1

Hi, I've created a phonegap project as follows. 
Scenario 1

|-apps
    |-project
        |-components
            |-ng-login(sling:resourceSuperType - project/components/ng-base-page)
                |-template.jsp
            |-ng-base-page(sling:resourceSuperType - mobileapps/components/angular/ng-page)
                |-template.jsp
        |-templates
            |-ng-login(sling:resourceType - project/components/ng-login)
            |-ng-page(sling:resourceType - project/components/ng-base-page)

When I open try to a page under the node /content/phonegap/project/en/home, the content in script template.jsp is not getting rendered.

Scenario 2
|-apps
    |-project
        |-components
            |-ng-login(sling:resourceSuperType - project/components/ng-base-page)
                |-ng-login.jsp
            |-ng-base-page(sling:resourceSuperType - mobileapps/components/angular/ng-page)
                |-ng-base-page.jsp
        |-templates
            |-ng-login(sling:resourceType - project/components/ng-login)
            |-ng-page(sling:resourceType - project/components/ng-base-page)

When I try to open a page under the node /content/phonegap/project/en/home, the content in script ng-login.jsp or ng-base-page.jsp gets rendered without any problem.

Can anyone please tell me why the script under template.jsp is not being rendered ?

Thank you.

1 Accepted Solution

Avatar

Correct answer by
Employee Advisor

The script in template.jsp is rendered when you have "template" selector in the URL. If you open the following URI - /content/phonegap/project/en/home.template.html then you will see it rendered. This project is implemented as an SPA (Single Page Application) pattern using the Angular JS framework. The SPA loads the full home page once and then gets the partial html fragments dynamically on user interaction/events. The html fragments which are loaded shouldn't have any header and footer as it is just a part of the page. Thats why every page template in this project has two views - the full page HTML (to support authoring) and the template view for including it as a fragment within the main page dynamically. 

For more information see this page - https://docs.adobe.com/docs/en/aem/6-1/develop/mobile-apps/apps/single-page-applications.html

View solution in original post

2 Replies

Avatar

Correct answer by
Employee Advisor

The script in template.jsp is rendered when you have "template" selector in the URL. If you open the following URI - /content/phonegap/project/en/home.template.html then you will see it rendered. This project is implemented as an SPA (Single Page Application) pattern using the Angular JS framework. The SPA loads the full home page once and then gets the partial html fragments dynamically on user interaction/events. The html fragments which are loaded shouldn't have any header and footer as it is just a part of the page. Thats why every page template in this project has two views - the full page HTML (to support authoring) and the template view for including it as a fragment within the main page dynamically. 

For more information see this page - https://docs.adobe.com/docs/en/aem/6-1/develop/mobile-apps/apps/single-page-applications.html

Avatar

Level 1

kunal23 wrote...

The script in template.jsp is rendered when you have "template" selector in the URL. If you open the following URI - /content/phonegap/project/en/home.template.html then you will see it rendered. This project is implemented as an SPA (Single Page Application) pattern using the Angular JS framework. The SPA loads the full home page once and then gets the partial html fragments dynamically on user interaction/events. The html fragments which are loaded shouldn't have any header and footer as it is just a part of the page. Thats why every page template in this project has two views - the full page HTML (to support authoring) and the template view for including it as a fragment within the main page dynamically. 

For more information see this page - https://docs.adobe.com/docs/en/aem/6-1/develop/mobile-apps/apps/single-page-applications.html

 

Why is it that I am able to open Geometrixx App pages without adding template.html and it still works fine ?