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
Header
Categories sidebar
blog:start
Slider
blog:items.startonly with articles

Article grid

blog:items.endonly with articles
blog:end
Footer
Slot: add your content hereDrawn by the engine
Blog index
SlotPositionContextNotes
blog:startTop of the main column, above the slider.twilightAlways rendered.
blog:items.startDirectly above the article grid.twilightOnly when there are articles to list.
blog:items.endDirectly below the article grid.twilightOnly when there are articles to list.
blog:endBottom of the main column.twilightAlways rendered, even with no articles.

Article

Route: Article.

/blog/article-title/a-123
Header
blog:single.start
Title, meta, body and tags
Commentsif the store allows them
blog:single.end
blog:single.related.startonly with related articles
Related article cards
blog:single.related.endonly with related articles
Footer
Slot: add your content hereDrawn by the engine
Blog article
SlotPositionContextNotes
blog:single.startTop of the article column, above the title.twilightAlways rendered.
blog:single.endBottom of the article column, below the comments.twilightAlways rendered. Comments appear only when the store allows likes and comments.
blog:single.related.startIn the sidebar, below the "Related" heading and above the first related article.twilightOnly when the article has related articles.
blog:single.related.endIn the sidebar, below the last related article.twilightOnly 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/category-name/c-12
Header
blog:<page>.start
Page title

Article grid

blog:<page>.end
Footer
Slot: add your content hereDrawn by the engine
Blog category, tag or author page

With no articles:

/blog/category-name/c-12
Header
blog:<page>.start
Empty state
blog:<page>.end
Footer
Slot: add your content hereDrawn by the engine
Same page, no articles

Replace <page> with category, tag or author.

SlotPositionContextNotes
blog:category.startTop of the main column, above the category name.twilightAlways rendered.
blog:category.endBelow the article grid.twilightAlways rendered.
blog:tag.startTop of the main column, above the tag name.twilightAlways rendered.
blog:tag.endBelow the article grid.twilightAlways rendered.
blog:author.startTop of the main column, above the author name.twilightAlways rendered.
blog:author.endBelow the article grid.twilightAlways 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.

app/components/blog/ArticleNewsletter.tsx
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.
  • useHook is the API used above.
  • Account slots covers the customer pages.

On this page