How the blog works
v0.0.1
Mishka Blog is a set of records, a set of admin screens that edit them, and a set of page blocks that read them. Knowing how the records relate, who can see each of them and what the blog adds to the CMS makes the screens and the settings easier to predict. This page explains that model. The steps for each task are in the how-to guides.
The records
Every record belongs to one site. The CMS can run many sites, and a blog record never crosses from one to another.
- A post is an article. It has a status, content, a cover, an excerpt and a reading time.
- A collection groups posts and is what readers see as a category. A collection can sit under a parent collection.
- A tag labels posts across collections. A tag can sit under a parent tag.
- A blogger is the public profile of one user account. Posts credit bloggers as their authors.
- A team groups bloggers. Its members are bloggers.
- A comment belongs to a post. A reply points at the comment it answers.
- An auto posting configuration stores settings for a named plugin on a site.
A post can have many collections, tags and authors, and each of those can have many posts. A blogger can be in many teams. Readers add records of their own: ratings, bookmarks, comment votes and follows of bloggers and teams.
What a visitor sees
A visitor sees a record only when it is in its public state and nothing locks it away from them.
| Record | Public when |
|---|---|
| Post | The status is Published. |
| Collection | The status is Active. |
| Team | The status is Active. |
| Tag, blogger | It is not archived. |
| Comment | The status is Approved, and its post is open to the visitor. |
Draft and scheduled posts, inactive collections and teams, pending, flagged and spam comments, and anything archived stay in the admin. Every public read is made as the visitor, so the permission locks in How blog locks work apply in the lists, the counts and the search, not only on the record's own page.
Editing, archiving and history
- Delete archives a record. It leaves the lists and the public pages, and Restore brings it back. Delete forever removes it and its history.
- An archived record cannot be edited. A restored post comes back as a draft. A restored collection or team comes back as active.
- Posts, collections, tags, bloggers, teams and configurations record a version each time they change, with who changed them. You can read a version and restore it. Comments are not versioned.
Languages
A post, a collection or a tag can exist in several languages. Each language is a separate record, and the records of one document share a language group. The Posts list shows one row for each group, and each language is a chip under it. A blogger or a team is a single record in every language. A block shows one edition of each record unless you ask for a language. On a page that shows a post, a collection or a tag, the header's language dropdown offers each published edition that the reader may open, at its own slug. Publish a post in more than one language shows the steps.
How the public pages are built
The sample pages and your own pages draw the blog with components. A block reads its first page with the page, so a crawler and a reader without JavaScript get the posts themselves, and it reads later pages in the background. Links between records are built from the bases you give a block, and the site's URL mode decides the final address.
A page reads its rows once. When a visitor opens the address of a page that shows a post, a collection, a tag, a blogger or a team, or the blog's front page, the blog reads that record with what the page draws of it. The read is made as the visitor, so the locks apply to it. The blog hands the rows to everything that draws the page: the head, the header's language dropdown and the bar, and the blocks that show the record, its list or its search. Without the shared read, each of them would ask the database for the same record on its own.
A block takes the rows only when the page's template hands them over, as the sample pages do, and only the blocks that show the page's own record, list or search accept them. The category list, the tag cloud and the people block always read for themselves, and so does a block you place on a page of your own without handing it the rows. A page can also declare that it shows each post, collection, tag, blogger or team. The blog then fills in that page's head, structured data and permissions from the record. See Show the blog on your own pages, and Page source: read a page's rows once for the event behind the read.
What the blog adds to the CMS
- A Blog entry in the admin sidebar, and the screens behind it.
- Five dashboard widgets, and a Blog tab in the settings.
- A notification to the holders of
admin:dashboard:blog:postwhen a post is published. - Posts, collections, bloggers and teams in the site's sitemap, with the tags that ask to be indexed, and a search and sharing head for every kind of record.
- Share images, drawn in the background when a record is saved.
- The components, icons and classes that posts use, added to the site's stylesheet. The components reach it when a page draws a post's body, as
blog-post-detaildoes. - The kinds of record a page can show: post, collection, tag, blogger and team.
- One read of the rows a blog page shows, shared by its head, its frame and its blocks.
- A bar under the site's header with the blog's name and its four places, Posts, Categories, Tags and People. The blog also hands the layout the languages of the record a page shows, for the header's language dropdown. See Page frame: languages and the section bar.
- An installer, which writes the components, pages and permission names for a site and registers the bar's words in the site's translations.
A site that never sets the blog up gets none of the components or sample pages, and the other sites on the installation are unaffected.
Auto posting
An auto posting configuration holds a plugin's name, a description, an on or off switch, and a map of that plugin's settings, one for each plugin on a site. The blog stores and lists these, and you can switch them on or off, archive them and read their versions. The blog does not run them: it contains no code that publishes a post from a configuration. They are for plugins that do.
Example: the life of a post
- An editor adds a post. It is a draft, visible only in the admin, and its first version is recorded.
- The editor files it under a collection, adds tags and credits two bloggers, and saves again. That is version two.
- The editor clicks Publish. The post gets a publish date and appears on the blog pages and in search. The other holders of
admin:dashboard:blog:postare notified. If its content uses a component, icon or class that no other published post uses, the site's stylesheet is rebuilt. - A reader comments. The comment is pending until a moderator approves it.
- The editor later restricts the collection with a permission. The post is now left out for readers who do not hold it.
- The editor archives the post. It leaves the public pages and stays in the archive with its history.