SPA Pages

Loading Pages using our SPA CMS

We already demonstrated loading pages via script using our first CMS. We made home, school, shop and resume pages. We loaded the home and resume pages with content. Here we do the same for our SPA version. We already made those four pages. We already loaded the heading level 1 h1 tag. Here we demonstate loading hte body of page. We loaded the home and resume pages with content.

Much of the code is the same as code presented in our first CMS. This is the latest version and so you will want to review how the code is organized this time around. Notice the class hierarchy is very shallow at this point. Everything is mostly parallel on the top level app scope. Later we will organize the code into deeper scopes so adding more apps even later will be smooth and easy.

Mission

Write functions for loading content in our SPA-CMS. These functions must be wired to button clicks. Designs and style layouts for the loaded content. Namely first design a fullscreen image layout for the home page's first article. Followed by a row of three panels that are ordered below each other on smalls screen and as side by side as columns on wider screens. Followed by an "about" article that contains an image floated to the left. And finally an image of a map diagram floated to the right. Then for the resume page an A4 US Letter Document page layout.

Loading Content in our SPA-CMS

Here is the script that loads all the pages. Currently just the home and resume pages are loaded. Notice how our page functions load articles functions.

a23_appx1y2y3.ldpgs.js

Source code of the load pages script.

All files

And here are all the files

a01_appx1y2y3.js

a03_appx1y2y3.click.js

a05_appx1y2y3.data.js

a07_appx1y2y3.data.imgList.js

a09_appx1y2y3.resumeJSON2SVGtxt.js

a21_appx1y2y3.init.js

a21_appx1y2y3.ldpgs.js

Demo page

Notice the url does not change with pages except the feedback button. The feedback button runs location.assign(#hashlink). We supply a hash link which links to the contact article loaded below it. It does not change pages or reload. You can confirm it does not reload the page by monitoring the console. Our app prints "init" to console just once. It does not print a second time after running location.assign(#hashlink).

demo