Welcome Guest to Defaut site!

Pages Controller Documentation

Last Updated: December 29, 2024
Author: Shanta
Status: Active

Overview

The Pages controller manages the content management system for the Ency schema. It provides a simple, practical approach to storing and delivering page content sorted by SiteName and roles, following existing Catalyst patterns and practices.

Routes and Testing

Public Routes:

Admin Routes (require admin role):

Key Features

Data Model

The Pages controller uses a single pages table in the Ency schema:

Table Structure

FieldTypeDescription
idINT AUTO_INCREMENTPrimary key
sitenameVARCHAR(255)Site identifier (CSC, MCOOP, etc.)
menuVARCHAR(255)Menu category (Main, member, Admin)
page_codeVARCHAR(255)Unique page identifier
titleVARCHAR(255)Page display title
bodyTEXTHTML content body
descriptionTEXTMeta description for SEO
keywordsTEXTMeta keywords for SEO
link_orderINTDisplay order in navigation
statusVARCHAR(50)Page status (active, inactive, draft)
rolesVARCHAR(255)Required access roles (public, member, admin)
created_byVARCHAR(255)Username who created the page
created_atDATETIMECreation timestamp
updated_atDATETIMELast modification timestamp

Controller Methods

Public Methods

Administrative Methods

Access Control

The controller implements role-based access control:

Templates

All templates follow existing TT patterns with PageVersion tracking:

Setup Instructions

  1. Create the database table: mysql ency < sql/pages_ency.sql
  2. Migrate existing data: perl script/migrate_pages.pl
  3. Test the routes listed above

Testing Routes

To test the page system, try these URLs:

Integration Points