Search by

drago-ex / project-static-page

accgit

Static page administration for Drago Project.

Package info

github.com/drago-ex/project-static-page

Type:drago-tools-resource

pkg:composer/drago-ex/project-static-page

Statistics

Installs: 147

Dependents: 2

Suggesters: 0

Stars: 0

Open Issues: 0

v2.1.1 2026-11-17 10:27 UTC

This package is auto-updated.

Last update: 2026-11-17 10:40:14 UTC


README

Static pages for Drago Project: pages such as "About us" with their own address and an optional item in the website menu, written in the administration.

PHP version Coding Style

Requirements

Installation

composer require drago-ex/project-static-page

Project Tools copies the files of the package into the project, where you adapt them. Set up what Assets lists and build the assets again (npm run vite:build).

Database

The migration creates the table static_page, empty:

php vendor/bin/migration db:migrate --packages

Pages are then written in the administration. bin/project-setup of Drago Project runs the migration for you.

Assets

The package has no scripts of its own. It uses:

A page on the website is in the look of the module blog of compostrap (the article and its content). Front UI already imports it; otherwise import it in assets/front.scss:

@import 'compostrap/src/scss/blog';

Administration

{link :Backend:Page:}

The menu item comes from Backend/Page/5.menu.neon with Backend UI. Pages are created, edited, deleted, filtered and sorted in a datagrid. A page has a title, content, slug, meta description, status (draft or published) and "Show in the menu" with its position. A slug whose address already belongs to another page of the site (admin, sign, en…) is refused.

Website

A published page is shown at the top level of the site, e.g. /o-nas (and /en/o-nas). The route is added by Front/Page/8.conf.neon before the front router and matches only slugs of published pages.

{link :Front:Page: slug: 'o-nas'}

Content is written in Texy and printed safely: raw HTML is limited to safe tags and links, headings start at <h2> and code blocks with a language are highlighted. The description is the <meta name="description"> of the page.

Pages with "Show in the menu" are returned by App\Model\Page\PageMenu::getItems() (slug => title, cached, cleaned when a page is saved or deleted). Print them in your layout (Front UI does it in its navbar):

$this->template->menuPages = $this->pageMenu->getItems();
<a n:foreach="$menuPages as $slug => $title" n:href=":Front:Page:default, slug: $slug">{$title}</a>

Permissions

The rules are in Backend/Page/acl.neon (resource Backend:Page, the administrator only) and Front/Page/acl.neon (resource Front:Page, everyone). The privileges of Backend:Page are default, edit and delete; buttons are shown only to those who may use them. Project Permission gives them to other roles.

The same files describe the privileges (permissionLabels) for the permissions page of Project Permission.