Public & Private
Table of Contents
- Overview
- URL Structure
- Configuration
- Implementation Guide
- File Structure
- Best Practices
Overview
The Public and Private modules in Core dna provide a streamlined way to create standalone pages that: - Use block functions or slots - Don't belong to specific modules - Need minimal loading requirements - Require specific access controls
- Automatic user authentication checks for private pages
- SEO-friendly URL routing
- Automatic 404/homepage redirects on errors
- JSON response support for all requests
URL Structure
Example URLs
Public URLs | Description |
https://sandbox10.coredna.com/public/contact-us | Basic public page |
https://sandbox10.coredna.com/public/about/about-us | Nested public page |
https://sandbox10.coredna.com/private/abc123/mytestfile | Protected private page |
Configuration
URL Arguments
https://sandbox10.coredna.com/?action=public&directory=about&form_name=about-us
Required Parameters:
Parameter | Description |
action | Module (public or private) |
form_name | Template to use |
directory | Optional. Directory path (single level only) |
Implementation Guide
URL Format Options
Both standard and pretty URL formats are supported:
# Standard Format https://sandbox10.coredna.com/?action=public&directory=about&form_name=about-us # Pretty URL Format https://sandbox10.coredna.com/public/about/about-us
File Structure
All templates must follow this structure:
Best Practices
- Use the Routing module for handling requests
- Implement proper access controls for private pages
- Maintain consistent URL structure across the site
- Keep template files organized in appropriate directories
- Use JSON responses when building APIs
Common Issues
- 404 Errors: Verify template path and file existence
- Access Denied: Check user authentication for private pages
- Routing Issues: Confirm URL structure and parameters