Complete guide to /admin/. All content is server-rendered; JavaScript only enhances interactions.
On this page
- Modules · Posts & pages · Taxonomies · Navigation · Themes & layouts · Plugins · i18n & AI · Settings · Tools · Writing conventions
Modules
Module (?s=) | Purpose |
|---|---|
dashboard | Stats, recent posts/pages/users |
posts | List, create, edit, delete, AI translation |
pages | Standalone pages (about, contact, docs) |
metas | Categories and tags, multilingual names, counts |
poly | Translation groups and AI translation (when plugin is on) |
notes | Private notes |
comments | Comment moderation |
users | Registered users and roles (admin / subscriber) |
attachments | Media library |
themes | Switch theme, theme settings |
layouts | Sidebar blocks and their order per page type |
upgrade | Version and one-click upgrade with automatic backup |
plugins | Enable / disable / uninstall |
market | Install themes & plugins from the market |
settings | Site, SEO, analytics, languages |
tools | Backup, repair, cache |
Disabled built-ins (notes, poly) disappear from the menu; third-party plugins with admin menus append plug_<id>.
Posts & pages
ye_contents stores both post and page rows:
| Field | Meaning |
|---|---|
title / slug | Title and URL segment; unique, must not use Router::RESERVED words |
excerpt / content | Excerpt and Markdown body |
description / keywords | SEO meta |
status | publish / draft; deleted_at soft delete is filtered in every front-end query |
published_at | Publish time (scheduling supported) |
template / order | Custom template, page order |
featured / allow_comment / password | Sticky, comments, password |
words / views | Word count, view count (written back by tools/sync-views.php) |
URLs are /<slug>.html; /docs and /changelog also have clean URLs. Prefer admin delete (soft delete); a hard delete must also clean ye_relationships and recalculate ye_metas.count.
Taxonomies
- Terms live in
ye_metas(category|tag), relations inye_relationships. countis a precomputed column — never replace it with a liveCOUNT()subquery in list views (see performance).- Multilingual names use
names_i18n(JSON) orname_en, aliases useslug_i18n. - Check references before deleting a term; recalculate counts after deleting posts.
Navigation
Nav::defs() in core/Nav.php is the single source for top/foot navigation; label is a language key and links get the language prefix automatically.
| Option | Effect |
|---|---|
nav.hide_top / nav.hide_foot | Hide items (JSON arrays) |
nav.custom | Add custom items (label / uri / zone / zh_only) |
Add fixed columns in Nav::defs() and add matching keys to lang/zh_CN.php + lang/en_US.php. For one-off pages, create them under Pages and link via custom nav.
Themes & layouts
- Themes reads
themes/<id>/theme.json; switching writestheme.default. - Theme settings only collect declared
settingsfields intotheme.options(JSON). - Layouts controls sidebar blocks per page type and their order;
theme.sidebar_mode=flow/sticky. - After changing either, flush page/block caches and rebuild the baked home page (cache).
Plugins
- Directory = manifest:
plugins/<id>/plugin.php. Enabling runs idempotentmigrations/first, then setsplugin.<id>.enabled=1. - Disabling only stops registration, data stays. Uninstall:
purge=1removes own tables + options (with automatic backup),purge=0keeps data. - Market accepts https packages only with mandatory SHA-256 verification; packages need a valid
plugin.php/theme.json; runphp -lon every file. - Bundled plugin list: quick start.
i18n & AI
- Multilingual manages
ye_poly_contents(group_id+lang); onlystatus=publishrows appear on the front end. - The AI translate button uses one language per request + a concurrency lock + a session queue that auto-continues, so one request can never saturate PHP-FPM (1.2.2).
- Overwrite translation re-translates existing languages but protects manual edits (
manual_override); target-language validation retries and fails loudly instead of storing the source text (1.2.3). - Full details: i18n & AI translation.
Settings
config.inc.php (never in version control):
| Constant | Meaning |
|---|---|
DB_HOST / DB_PORT / DB_NAME / DB_USER / DB_PASS | Database connection |
DB_PREFIX | Table prefix, ye_ by default |
SECRET | Sessions and key encryption; rotating invalidates encrypted keys |
TZ / SITE_LANG / DEBUG | Timezone, default UI language, debug (production: false) |
Site options (ye_options):
| Option | Meaning |
|---|---|
site.name / site.name_en / site.subtitle* | Names and tagline |
site.description / site.keywords | SEO meta |
site.languages / site.default_lang | Enabled languages, base language |
theme.default / theme.options / theme.sidebar_mode | Theme and layout |
home.landing / home.style / home.show_circle | Home layout |
nav.hide_top / nav.hide_foot / nav.custom | Navigation |
stats.head / stats.foot / stats.posts_total | Analytics slots, denormalised post total |
market.source | Market manifest URL; empty = var/market/manifest.json |
blog.disabled | 1 disables blog routes (categories/tags/archives/search) for a pure corporate site |
Secrets belong in the admin UI, encrypted with SECRET, never echoed in plaintext; keep them out of logs, error pages and exports.
Tools
php -r 'chdir("/www/wwwroot/yecha.org"); require "config.inc.php"; require "core/bootstrap.php"; Cache::flush("pages"); Cache::flush("blocks");'
php tools/upgrade.php --component core --dry-run
php tools/upgrade.php --component core
php tools/sync-views.php
curl -s -H 'Host: example.com' https://127.0.0.1/ > /dev/nullBackup/upgrade/rollback: operations.
Writing conventions
- Markdown body:
##/###headings, tables, lists, quotes, ``lang fences,{#anchor}` explicit anchors. - Body is HTML-escaped first — do not embed HTML; for special layouts use a theme view or a core renderer (like the structured
/changelogtimeline). - File/function names use inline
code; commands and config go in fenced blocks (language tags render as a corner badge). - Internal links:
/<slug>.html,/en/<slug>.htmlfor English; taxonomy links come fromPoly::termUrl()— never hand-write language prefixes.