Blog slots
Every slot on the blog index, article, category, tag and author pages, with where it renders and what it passes.
Use blog slots when you want to add a promo, a newsletter signup or extra content to the blog without replacing its pages. For how useHook, priority, fallback and cleanup work, see Slots and Page frame slots.
Framework: TanStack Start
These slots are rendered by the engine's TanStack Start routes.
Context
No blog slot passes its own context. Every handler receives only twilight (store, theme and more). To show article data, read it from your own hook or loader.
Blog index
Route: Blog.
blog:startblog:items.startonly with articlesArticle grid
blog:items.endonly with articlesblog:end| Slot | Position | Context | Notes |
|---|---|---|---|
blog:start | Top of the main column, above the slider. | twilight | Always rendered. |
blog:items.start | Directly above the article grid. | twilight | Only when there are articles to list. |
blog:items.end | Directly below the article grid. | twilight | Only when there are articles to list. |
blog:end | Bottom of the main column. | twilight | Always rendered, even with no articles. |
Article
Route: Article.
blog:single.startblog:single.endblog:single.related.startonly with related articlesblog:single.related.endonly with related articles| Slot | Position | Context | Notes |
|---|---|---|---|
blog:single.start | Top of the article column, above the title. | twilight | Always rendered. |
blog:single.end | Bottom of the article column, below the comments. | twilight | Always rendered. Comments appear only when the store allows likes and comments. |
blog:single.related.start | In the sidebar, below the "Related" heading and above the first related article. | twilight | Only when the article has related articles. |
blog:single.related.end | In the sidebar, below the last related article. | twilight | Only when the article has related articles. |
Category, tag and author pages
Routes: Category, Tag, Author.
These three pages share one layout: breadcrumb, categories sidebar, then the main column.
With articles:
blog:<page>.startArticle grid
blog:<page>.endWith no articles:
blog:<page>.startblog:<page>.endReplace <page> with category, tag or author.
| Slot | Position | Context | Notes |
|---|---|---|---|
blog:category.start | Top of the main column, above the category name. | twilight | Always rendered. |
blog:category.end | Below the article grid. | twilight | Always rendered. |
blog:tag.start | Top of the main column, above the tag name. | twilight | Always rendered. |
blog:tag.end | Below the article grid. | twilight | Always rendered. |
blog:author.start | Top of the main column, above the author name. | twilight | Always rendered. |
blog:author.end | Below the article grid. | twilight | Always rendered. |
Each of these slots appears twice in the page source because each page has two branches: one when the category, tag or author has no articles (an empty state sits between the slots, with no title), and one when it has articles (title and grid sit between them). Only one branch renders, so a handler shows once. Because the empty branch has no title, do not assume a heading is present in either slot.
Example
Add a newsletter prompt below every article, using the article slot. Render the component once under your layout, as described in useHook.
import { useHook } from '@salla.sa/twilight-theme-engine/hooks/useHook';
export function ArticleNewsletter() {
useHook('blog:single.end', () => (
<aside className="mt-8 rounded border p-4">
<h2 className="font-bold">Enjoyed this article?</h2>
<p className="text-sm">Subscribe to get new posts in your inbox.</p>
</aside>
));
return null;
}Next
- Slots explains how registration, priority and fallback work.
useHookis the API used above.- Account slots covers the customer pages.