# Topics & Pages

## Overview

Topics provide lightweight CMS pages for static content such as "About us" or legal notices. Each topic defines a unique system name, HTML body and optional metadata. When you assign an SEO slug the topic becomes reachable as its own page. Topics support per-language content, store and role restrictions, sitemap inclusion and optional password protection.

## Editing

Administrators manage topics under **Content > Topics**. Key fields include:

* **System name** – stable identifier used in code and link expressions.
* **Body / Intro** – HTML content edited through the WYSIWYG editor.
* **Meta data** – `SeName`, `MetaTitle`, `MetaDescription` and keywords.
* **Render as widget** – also display the topic in specified zones.
* **ACL / Stores** – limit visibility to particular customer roles or stores.

## Rendering a topic

Embed a topic in any view with the `TopicBlock` view component:

```csharp
@await Component.InvokeAsync("TopicBlock", new { systemName = "AboutUs" })
```

A topic with a saved slug renders as a standalone page handled by `TopicController.TopicDetails`. Menus and other components can link to it via the [link resolver](/framework/advanced/linkresolver.md):

```csharp
builder.Item("About us", i => i.Url("topic:AboutUs"));
```

```
var aboutUrl = await Url.TopicAsync("AboutUs");
```

## Widget mode

When *Render as widget* is enabled, Smartstore turns the topic into a `TopicWidget` and injects it into each listed [widget zone](/framework/content/widgets.md#zones). Wrapper options (`WidgetWrapContent`, `WidgetShowTitle`, `WidgetBordered`) control presentation, while `Priority` defines sort order within the zone.

## Programmatic access

Topics reside in `SmartDbContext.Topics`. Use `TopicQueryExtensions.ApplyStandardFilter()` to respect publication, store and ACL settings when querying:

```csharp
var topics = await _db.Topics
    .ApplyStandardFilter()
    .OrderBy(t => t.SystemName)
    .ToListAsync();
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://dev.smartstore.com/framework/content/topics-and-pages.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
