Phonegap Issue | Community
Skip to main content
December 17, 2015
Solved

Phonegap Issue

  • December 17, 2015
  • 2 replies
  • 681 views

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.

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

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

2 replies

Kunal_Gaba_
Kunal_Gaba_Accepted solution
December 17, 2015

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

December 18, 2015

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 ?