The public blog is available on every site at /s/{site-slug}/blog as soon as the module is installed. This page covers how to link to it, embed posts on other pages, and adapt the templates to your theme.
Adding the blog to site navigation
- Go to Admin > Sites > (your site) > Navigation.
- In the Add a link panel, choose the Blog link type.
- Enter a Label (defaults to "Blog") and drag the link into position.
- Click Save.
The label you enter is also used as the heading and page title of the blog index. Without a Blog navigation link the heading falls back to "Blog".
Public pages
| Page | URL |
|---|---|
| Index | /s/{site-slug}/blog (paginated with ?page=N) |
| Single post | /s/{site-slug}/blog/post/{slug} |
| Author archive | /s/{site-slug}/blog/author/{user-id} |
| Tag archive | /s/{site-slug}/blog/tag/{tag-slug} |
| Category archive | /s/{site-slug}/blog/category/{category-slug} |
| Preview (logged in) | /s/{site-slug}/blog/post/{slug}/preview |
The index shows post summaries (thumbnail, title, author, date, category, excerpt, tags, Read more) with a sidebar of categories and tags, and Previous / Next pagination. The post page shows the byline, content, tags, the comments section, More posts by the author, and a sidebar with the featured image and the About the author box.
The Blog Posts page block
Embed a list of posts on any site page:
- Edit the page under Admin > Sites > (site) > Pages and add a Blog Posts block.
- Set the options below and save the page.
| Option | Default | Description |
|---|---|---|
| Block heading | empty | Heading above the list. It links to the blog index, or to the category or tag archive when a filter is set. |
| Number of posts to display | 5 |
1 to 50. |
| Show post title | on | |
| Show excerpt | on | Excerpt with HTML stripped, cut at 300 characters. |
| Show featured image | on | |
| Show date | on | Publish date. |
| Show author | on | |
| Show category | on | Category pill. |
| Show tags | on | Tag pills. |
| "Read more" link text (leave blank to hide) | Browse all posts |
A link after the list to the same destination as the heading. |
| Filter by category | All categories | Show only posts in one category. |
| Filter by tag | All tags | Show only posts with one tag. |
The block only shows published, non-scheduled posts assigned to the page's site. It renders "No posts found." when nothing matches.
Theme templates
The module ships working templates and appends its stylesheet (asset/css/blog.css) on blog pages and on pages that contain a Blog Posts block. To customise, copy any of these files into your theme at the same path and edit the copy:
view/omeka/site/blog/index.phtml
view/omeka/site/blog/show.phtml
view/omeka/site/blog/author.phtml
view/omeka/site/blog/tag.phtml
view/omeka/site/blog/category.phtml
view/common/block-layout/blog-posts.phtml
Templates receive plain arrays: $posts (each with title, slug, excerpt, content, status, published_at, author_name, category_name, category_slug, featured_image_url and a tags array), plus $total, $page, $perPage, and on the index $categories and $tags. The post page additionally receives $post (with an author array of name, avatar, bio), $category, $tags, $comments (approved), $commentForm (a Blog\Form\CommentForm, or null when comments are off), $recentByAuthor, $jsonLd and $isPreview. Always pass true as the fourth argument of $this->url() so links keep the current site slug:
<?php echo $this->url('site/blog/post', ['slug' => $post['slug']], [], true); ?>
Styling
blog.css is theme-agnostic and driven by CSS variables you can override in your theme stylesheet:
:root {
--blog-accent: #2b6cb0; /* Read more button, category pills */
--blog-bg: #ffffff; /* post summary background */
--blog-muted: #6b7280; /* meta text */
--blog-border: #e6e6e6;
--blog-radius: 0px;
}
Useful class names: .post-summary, .post-summary__title, .post-summary__meta, .post-summary__excerpt, .post-category, .post-tag, .tag-cloud, .blog-index__sidebar, .blog-post__layout, .blog-post__content, .blog-post__sidebar, .author-box, .author-recent-posts, .blog-posts-block, .blog-pagination.
Built-in behaviour on post pages
- Lightbox: images inside the post content and the sidebar featured image open in an overlay when clicked. Close with the button, by clicking outside, or with Escape.
- Code highlighting:
<pre><code>blocks inserted with the CKEditor code snippet button are highlighted with highlight.js (GitHub style). - Structured data and feeds: see Feeds and Sitemap.