Public & Private


Skip to end of metadata
Sometimes it is necessary to create pages which do not belong to any particular module, but simply host use some block functions or slots, The Public and Private modules are intended to allow easy access to Core dna with minimal loading. They use the Routing and SEO-URL centre options to route to the correct template. If there is an error loading, a 404 or homepage redirect will be returned.

Anything which does not require a user login can be routed through the the Public module, e.g: 'about' page with a block function to display a contact form. If it requires a user to be logged in, for example 'my-account' page, then it must go though the Private module. Core dna will automatically check each request if the user is logged in so the front end does not have to. If the user is logged out and they request a private URL, then they will be redirected to the login page.
 

Example URL's

  1. https://sandbox10.coredna.com/public/contact-us 
  2. https://sandbox10.coredna.com/public/about/about-us 
  3. https://sandbox10.coredna.com/private/abc123/mytestfile 
  4. https://sandbox10.coredna.com/private/simple 

It is possible to specify a directory and then a template name. the last argument will always be the template to use (sans the .html extension) and if there is another level between public/ or private/ then that will be used as the directory.

Every P&P request supports the JSON reponse type.

Arguments

It is recommend to use the Routing module to handle Public and Private requests

You can pass in arguments into each request simply in the following format:

https://sandbox10.coredna.com/?action=public&directory=about&form_name=about-us
  • required | action - module (public or private)
  • required | form_name - the template to use
  • optional | directory - the directory to use. Must come before the form_name template name. Only supports one level under templates.


P&P also support the use of pretty URL parameters, for instance the above example becomes

https://sandbox10.coredna.com/public/about/about-us

Both URL point to the same location.

File Structure

All P&P templates must be located under a directory called templates, then the directory name passed or just under the templates directory itself.

The sandbox examples are shown below: