Is it possible to share common html between pages?


if have block of html common multiple pages - example ul table containing site menu, @ present copy , paste html onto every page.

 

however, if change menu, have repeat process.

 

is there way of having common html files somehow 'included' phonegap cli build process, similar '@import' in sass example?

 

or missing obvious?

 

thanks

yes, none of accomplished using phonegap cli. cli tool packaging www content hybrid app -- how generate www you.

 

i suggest:

  • single page architecture
    • this little bit of misnomer -- it's not app has 1 page, has single dynamic dom. pages inserted dynamically existing dom, means can keep app state around , not have manage passing via query parameters or persisting session storage.
    • avoids reloading , reiniting cordova , plugins each time navigation occurs
    • app state persists through navigation, have way more careful memory management.
  • templating
    • lets reuse components , render data-driven views
    • which templating library use depend upon needs , (often) chosen framework
  • module bundling/packing (browserify, webpack, jspm)
    • bundles nice, neat package

 

however, since pg uses webview render app's content, can use building mechanism want. if app simple enough, might able static site generator (like hugo). don't suggest that, because it's not going terribly performant (each navigation triggers reinitialization of cordova , plugins), option there if want use it.



More discussions in PhoneGap


adobe

Comments

Popular posts from this blog

Reader DC

AdobeIDの作り方

Adobe InDesign CC 2017 has stopped working