-
-
Notifications
You must be signed in to change notification settings - Fork 49
Anatomy of a Theme
Chyrp Lite allows you to extend your blog with powerful themes that can radically alter its presentation and behaviour, using the Twig template engine. Themes are added to Chyrp Lite by copying them into the themes directory in the Chyrp Lite installation, where each theme should be located in its own subdirectory. A fresh install of Chyrp Lite comes with four themes.
A Chyrp Lite theme is structured as follows:
- theme
-
content
- post.twig
- preview.twig
-
feathers
- audio.twig
- link.twig
- photo.twig
- quote.twig
- text.twig
- uploader.twig
- video.twig
- missing.twig
-
forms
- user
- register.twig
- login.twig
- controls.twig
- lost_password.twig
- reset_password.twig
- user
- info.php
-
javascripts
- JavaScript files.
-
layouts
- default.twig
-
pages
- 403.twig
- 404.twig
- archive.twig
- drafts.twig
- index.twig
- page.twig
- search.twig
- updated.twig
- view.twig
-
stylesheets
- CSS files.
-
content
This file contains attribution and version information that Chyrp Lite will display in the administration console.
The layouts directory contains default.twig that provides the container for every blog page rendered by Chyrp Lite.
The pages directory contains template twigs that extend default.twig in different contexts. If you add new pages to your blog, they can be given a unique appearance by adding a twig for them in this directory, using the naming convention page_<<page URL >>.twig.
extends: layouts/default.twig
This twig is the template for a 403 (forbidden) error page.
extends: layouts/default.twig
This twig is the template for a 404 (resource not found) error page.
extends: layouts/default.twig
This twig is the template for a page that displays a chronological archive of blog posts.
extends: layouts/default.twig
This twig is the template for a page that displays the draft blog posts of a logged-in user.
extends: layouts/default.twig
This twig is the template for a page that displays the blog index.
extends: layouts/default.twig
This twig is the template for a page that displays a paginated blog post, if the pagination module is enabled.
extends: layouts/default.twig
This twig is the template for a page that displays the blog posts returned a search.
extends: layouts/default.twig
This twig is the template for a page that displays updated posts in order of update.
extends: layouts/default.twig
This twig is the template for a page that displays a single blog post in isolation.
This twig renders blog posts. It is extended by whichever Feather was used to create the post.
This twig renders previews in an iframe on the Write pages. The twig should display an approximation of how the text will appear in a published post or page.
The feathers directory contains twigs dedicated to various Feathers.
extends: content/post.twig
This twig allows Chyrp Lite to render plain text blog posts handled by the text Feather.
extends: content/post.twig
This twig allows Chyrp Lite to render audio posts handled by the audio Feather.
extends: content/post.twig
This twig allows Chyrp Lite to render video posts handled by the video Feather.
extends: content/post.twig
This twig allows Chyrp Lite to render link posts handled by the link Feather.
extends: content/post.twig
This twig allows Chyrp Lite to render photo posts handled by the photo Feather.
extends: content/post.twig
This twig allows Chyrp Lite to render quoted text blog posts handled by the quote Feather.
extends: content/post.twig
This twig allows Chyrp Lite to render blog posts with attached files handled by the uploader Feather.
extends: content/post.twig
This twig is displayed as a fallback if the theme does not have a template to support a Feather type.
The forms directory contains twigs that contain HTML forms for various purposes.
extends: layouts/default.twig
This twig allows a visitor to your blog to become a registered user.
extends: layouts/default.twig
This twig allows a registered user to log in.
extends: layouts/default.twig
This twig allows a registered user to change various details, including their password.
extends: layouts/default.twig
This twig allows a registered user to reset their password.
extends: layouts/default.twig
This twig displays a password reset form that can only be accessed within 1 hour of request.
The javascripts and js directories contain JavaScript files that will be loaded by the theme's pages. Files with names containing .inc.js will not be served to the visitor.
The stylesheets and css directories contain CSS files that will be loaded by the theme's pages. Files with names containing .inc.css will not be served to the visitor, allowing you to @import
them in one of your other stylesheets.
This is the wiki for Chyrp Lite: An ultra-lightweight blogging engine, written in PHP.
- About Permissions
- Tour of a Theme
- Twig Reference
- Twig Variables
- Object Attributes
- Routes and Controllers
- Making Your First Module
- Debug and Tester Modes
- About Errors
- Introduction to Helpers
- Introduction to Translations
- Introduction to Triggers
- Anatomy of info.php Files
- Anatomy of a Feather
- Anatomy of a Module
- Anatomy of a Theme
- Anatomy of a Post
- Localizing Extensions
- Adding Ajax Functionality
- Working with JavaScript
- Working with Model
- Working with Config