Customization Guide

Make the Static Content plugin work exactly the way you need it.

Configuration Options

Set these in your app.ini under the [plugins] section:

[plugins]
djebel-static-content.cache = 1
djebel-static-content.sort_by = creation_date
djebel-static-content.show_date = 1
djebel-static-content.show_tags = 1
djebel-static-content.show_author = 1
djebel-static-content.show_summary = 1
djebel-static-content.show_category = 0

Available Hooks

The plugin provides several filters for customization. Always use class methods for callbacks, never closures.

Modify Available Statuses

$obj = My_Plugin::getInstance();
Dj_App_Hooks::addFilter('app.plugin.static_content.statuses', [ $obj, 'filterStatuses', ]);

// In your class:
public function filterStatuses($statuses, $ctx)
{
    $statuses[] = 'archived';

    return $statuses;
}

Modify Blog Data Before Rendering

$obj = My_Plugin::getInstance();
Dj_App_Hooks::addFilter('app.plugin.static_content.data', [ $obj, 'filterBlogData', ]);

// In your class:
public function filterBlogData($blog_data, $ctx)
{
    // Custom filtering or modification

    return $blog_data;
}

Change Sort Field

$obj = My_Plugin::getInstance();
Dj_App_Hooks::addFilter('app.plugin.static_content.sort_by', [ $obj, 'filterSortBy', ]);

// In your class:
public function filterSortBy($sort_by, $ctx)
{
    $sort_by = 'title';

    return $sort_by;
}

Add Extra Scan Directories

$obj = My_Plugin::getInstance();
Dj_App_Hooks::addFilter('app.plugin.static_content.scan_dirs', [ $obj, 'filterScanDirs', ]);

// In your class:
public function filterScanDirs($dirs, $ctx)
{
    $dirs[] = '/path/to/extra/content';

    return $dirs;
}

Styling

The plugin outputs HTML with CSS class names prefixed with djebel-plugin-static-content-. Style these classes in your theme's CSS to match your design.

Key classes:

  • .djebel-plugin-static-content-post — individual post in the listing
  • .djebel-plugin-static-content-post-title — post title
  • .djebel-plugin-static-content-post-meta — date, author, category
  • .djebel-plugin-static-content-post-summary — post summary text
  • .djebel-plugin-static-content-post-tags — tag pills container
  • .djebel-plugin-static-content-pagination — pagination controls