API / Minn\Blocks\Dynamic\Theme / PostBlocks

PostBlocks final readonly class

Minn\Blocks\Dynamic\Theme\PostBlocks · public/minn/src/Minn/Blocks/Dynamic/Theme/PostBlocks.php · 260 lines

The post-* blocks: they render the context's current post.

Constants and properties

privatereadonly Minn\Content\Posts $posts

Promoted from the constructor.

privatereadonly Minn\Content\Users $users

Promoted from the constructor.

privatereadonly Minn\Content\Site $site

Promoted from the constructor.

privatereadonly Minn\Front\Permalinks $permalinks

Promoted from the constructor.

Public

new__construct(Minn\Content\Posts $posts, Minn\Content\Users $users, Minn\Content\Site $site, Minn\Front\Permalinks $permalinks)#
methodregister(Minn\Blocks\Renderer $renderer): void#

Registers this family's blocks with the renderer.

Internals 12

Private and protected methods: how the class does its work. Not a contract; they change whenever the code is tidied.

privatetitle(Minn\Blocks\Block $block, Minn\Blocks\Renderer $renderer): string#
privatecontent(Minn\Blocks\Block $block, Minn\Blocks\Renderer $renderer): string#

In a loop the content stops at the more tag with a "(more…)" link; on its own page it runs whole.

privatedate(Minn\Blocks\Block $block, Minn\Blocks\Renderer $renderer): string#
privateauthorName(Minn\Blocks\Block $block, Minn\Blocks\Renderer $renderer): string#
privateexcerpt(Minn\Blocks\Block $block, Minn\Blocks\Renderer $renderer): string#
privatefeaturedImage(Minn\Blocks\Block $block, Minn\Blocks\Renderer $renderer): string#
privateterms(Minn\Blocks\Block $block, Minn\Blocks\Renderer $renderer): string#
privatenavigationLink(Minn\Blocks\Block $block, Minn\Blocks\Renderer $renderer): string#

Off a single post or page there is no neighbour to link: nothing at all.

privatetermRow(string $taxonomy, int $termId): ?Minn\Content\TermRecord#
privatepreviewSource(Minn\Content\PostRecord $post, Minn\Front\Resolution $resolution): ?Minn\Content\PostRecord#

On a preview, the post's newest autosave, whoever wrote it, stands in for its stored fields (as _set_preview does).

privatetarget(Minn\Blocks\Block $block): string#
privateopen(string $tag, array $classes, Minn\Blocks\Block $block, bool $styleFirst = false, bool $linkColorClass = false): string#