How to display the detailed content page of articles or products?

Calendar 👁️ 62

In AnQi CMS, the display of article or product detailed content pages is the core link of website content operation.A well-designed, comprehensive detail page that not only effectively conveys content value but also enhances user experience and search engine optimization.The Anqi CMS provides a powerful and flexible toolkit that allows us to easily achieve these goals.

The cornerstone of content: content model and template files

In AnQi CMS, all articles and products are uniformly regarded as "content" (archive). They can display different forms, such as a news article and a product detail, thanks to the flexibleContent modelFunction. We can customize content models according to business needs, configuring exclusive fields for different types of content (such as "article model" or "product model"), for example, articles may have "author" or "publish date", while products have "price" or "inventory" and so on.These custom fields are the source of personalized information displayed on the detail page.

After the content is created and published in the background, how to present it to the user on the front-end depends onTemplate Filesdecides. The template system of Anqi CMS adopts a syntax similar to the Django template engine, using.htmlAs a template file suffix. For detailed content pages of articles or products, it is usually used{模型table}/detail.htmlsuch naming conventions. For example, if your content model is "article" (usually corresponding toarticleThe table, then the default detail page template file isarticle/detail.html. If you want a specific article or product to use a unique layout, you can also specify a custom template file for it in the background, for examplearticle/your-special-story.htmlAs long as this file exists, the system will prioritize it.

Core feature: clever applicationarchiveDetailTag

To dynamically display content data on the detail page, we need to rely on Anqi CMS.Template TagAmong the most crucial isarchiveDetailThis tag is the key to obtaining all the details of the current article or product

We can use it in many waysarchiveDetailTags:

  • Directly access the current page field:In any article or product detail page, you can directly use{{archive.文档字段}}to call the various information of the current content. For example, to display the title, directly{{archive.Title}}Just do it.
  • to specify the field to obtain:If you want to get a field more explicitly, you can use{% archiveDetail with name="字段名称" %}. For example, get the title of the current content:{% archiveDetail with name="Title" %}.
  • Display rich text content safely:For rich text content such as article or product descriptions that may contain HTML tags (Contentfield), we must use|safeFilter, for example{{archive.Content|safe}}This ensures that the HTML content is correctly parsed and rendered, rather than being displayed as plain text.If your content is in Markdown format, Anqi CMS can also automatically render it, and it can also berender=trueparameters for manual control, for example{{archive.Content|render|safe}}.
  • images and multimedia:The detail page often needs to display images.archiveDetailIt is convenient to get thumbnails (Thumb) and cover main image (Logo) even a set of images (Images, and needs to be accessed byforLoop through and display).
  • Custom field display:For various custom fields defined in your content model (such as "Product Model", "Author"), you can usearchiveParamsLabel to retrieve and display. You can iterate over all custom parameters to display uniformly, or directly through{% archiveDetail with name="您的自定义字段名" %}to retrieve the value of a specific field.

For example, a typical article detail page may look like this:

<article>
    <h1>{% archiveDetail with name="Title" %}</h1>
    <div class="meta-info">
        <span>发布时间:{{ stampToDate(archive.CreatedTime, "2006-01-02") }}</span>
        <span>浏览量:{% archiveDetail with name="Views" %}</span>
        <a href="{% categoryDetail with name='Link' %}">分类:{% categoryDetail with name='Title' %}</a>
    </div>
    <div class="content">
        {% archiveDetail articleContent with name="Content" render=true %}{{ articleContent|safe }}
    </div>
    {% if archive.自定义字段名 %}
    <div class="custom-field">
        自定义信息:{% archiveDetail with name="自定义字段名" %}
    </div>
    {% endif %}
</article>

Enhancing user experience: the details are exquisite

An excellent detail page is not just a pile of content, it also needs to consider the user's browsing experience and information acquisition efficiency. Anqi CMS provides various auxiliary tags to enrich the functionality of detail pages:

  • Clear navigation path: breadcrumbs(breadcrumbTag) By using breadcrumb navigation, users can clearly understand the position of the current page in the website structure, making it convenient to backtrack. In the template, use{% breadcrumb crumbs %}It can be generated.
  • Linked: previous and next articles.(prevArchiveandnextArchiveTag) Add "Previous" and "Next" links at the bottom of articles or product details to effectively guide users to continue browsing related content and extend their stay time.
  • Smart recommendation: related content(archiveListtags, with the help oftype="related") Based on the content of the current detail page (such as same category, same keywords), intelligent recommendations for related articles or products can improve the discovery rate and user stickiness.
  • Interactive feedback: Comment system(commentListLabel) If your website allows users to comment, you can integrate a comment list and comment form at the bottom of the detail page to enhance user engagement.The comment submission and like function both provide the corresponding API interface.
  • Optimize visibility: TDK settings(tdkLabel) Although most of the TDK (title, keywords, description) of the detail page have been set when the content was published, but the template tagtdkcan be on the pageheadEnsure that these key SEO information is correctly output, for example:
    
    <title>{% tdk with name="Title" siteName=true %}</title>
    <meta name="keywords" content="{% tdk with name="Keywords" %}">
    <meta name="description" content="{% tdk with name="Description" %}">
    

URL structure and SEO: The power of pseudo-statics

The URL structure of the detail page is crucial for search engine optimization (SEO). Anqi CMS supports powerfulStatic rulesCustomization, we can configure the URL of the article or product detail page to display in a friendly and meaningful way, rather than with long dynamic parameters. For example,/article?id=123Optimize to `/article/my-great-

Related articles

How to get and display all articles under a specific category?

In website content management, effectively organizing and displaying articles is the key to improving user experience and the clarity of the website structure.Strong and flexible template tag features are provided by AnQi CMS, allowing you to easily retrieve and display all articles under a specific category.Ensure content structure clarity: The foundation of backend category settings Before starting operations at the template level, we must first ensure that the content structure of the backend is clear and reasonable.The AnQi CMS category management feature is located under the "Content Management" module, where you can create and manage various article categories, such as "Company News"

2025-11-09

How to display the latest articles or product lists on the website?

In Anqi CMS, it is an important aspect to manage and display website content, especially to allow visitors to see the latest published articles or product dynamics, which is crucial for enhancing user experience and website vitality.A dynamically updated website can not only attract users to continue visiting, but also is very beneficial for search engine optimization (SEO).AnQi CMS provides a powerful and flexible tag system, allowing us to easily meet this requirement.### Core Tool: `archiveList` Tag The most core tool to display the latest articles or product lists on any page of the AnQi CMS website is

2025-11-09

How to use the anchor text feature of AnQiCMS to improve the display effect of internal links?

The internal links of the website are like a complex maze, guiding users and search engines through various pages.And the anchor text, which is the 'road sign' on this map, directly determines the efficiency and user experience of navigation.A clear and relevant anchor text not only enhances user click-through intention but is also an important basis for search engines to understand page content and evaluate page authority.AnQiCMS as an efficient content management system is well-versed in this, providing a strong and flexible anchor text feature to help us easily improve the display effect of internal links.###

2025-11-09

What is the role of Sitemap and Robots.txt in content visibility?

Enhancing website content visibility: The key role of Sitemap and Robots.txt in Anqi CMS Making website content visible to more people is the core goal of every content operator.In a world of information overload on the Internet, search engines are the bridge for users to discover content, and in this competition to gain the attention of search engines, Sitemap (site map) and Robots.txt (crawler protocol file) are two indispensable tools.For users of AnQi CMS, the powerful functions of these two tools have been integrated into the system

2025-11-09

How to display a list of recommended articles related to the current article?

In website operation, recommending relevant articles to readers is an important strategy to enhance user experience, prolong user stay time, and optimize SEO.After a reader finishes reading an article, if they can immediately see highly relevant recommendations related to the current content, it will undoubtedly greatly increase their interest in continuing to explore the website.AnQi CMS understands this need and provides powerful and flexible features to help users easily achieve this goal.### AnqiCMS's "Related Documents" feature One of the core strengths of AnqiCMS lies in its powerful content management and template tag system

2025-11-09

How to retrieve and display the list of all categories on the website?

In Anqi CMS, the website category list is the foundation for building clear navigation, enhancing user experience, and optimizing search engine rankings.Whether it is to establish a classification system for articles, products, or other content models, AnQiCMS provides flexible and powerful tools to easily obtain and display these classifications.One of the core concepts of AnQiCMS is to make content management efficient.It organizes the content into different "content models", such as common article models and product models.Each content model can have an independent classification system. Understanding this is the first step to obtaining the classification list.

2025-11-09

How to display subcategories on the category page, or show the article list when there are no subcategories?

In website operation, the content display logic of category pages has an important impact on user experience and information architecture.We often encounter such needs: when there are subcategories under a category, it is preferred to display these subcategories to facilitate users in navigating more finely;And if the category does not have subcategories, then directly display the list of articles under the category, to avoid the page content being empty or the navigation level being too deep.AnQiCMS (AnQiCMS) provides flexible template tags that can easily achieve this dynamic display effect.### Understand the dynamic display logic of the category page To implement the intelligent display of the category page

2025-11-09

How to display a list of all independent web pages of the website?

In AnQiCMS, the independent pages of a website play a crucial role, usually carrying core information such as "About Us", "Contact Information", "Privacy Policy", etc. They are an indispensable part of building website trust and perfecting the information architecture.This article will introduce how to effectively manage and display these independent page lists in Anqi CMS. ### Understanding the 'Independent Page' in AnQi CMS In the context of AnQi CMS, what we refer to as the 'Independent Page' corresponds to the 'Single Page' feature in the system.These pages and articles

2025-11-09