How to display AnQiCMS single-page content and related images?

Calendar 👁️ 60

In website operation, we often need to create some independent pages, such as "About UsThese pages contain relatively fixed content, which does not belong to the conventional article or product list. AnQiCMS (AnQiCMS) categorizes them as "single pages" and provides a very convenient way to manage and display them.Through this system, you can easily publish and update this content, while flexibly controlling their display style and image presentation.


Create and manage your single-page content

First, you need to create and manage these single pages in the Anqi CMS backend. This is very intuitive:

In the left navigation bar of the background management interface, find and click on the 'Page Resources' under the 'Page Management' option.Here, you can browse the existing single-page list, or click the "Add Single Page" button to create a new page.

When adding or editing a single page, the system provides a rich set of fields for you to fill in:

  • Page NameThis is the title displayed on your page in the frontend, which is also the first content users see.
  • SEO title, keywords, single page summaryThese are prepared for search engine optimization (SEO), you can set a unique TDK (Title, Description, Keywords) for each single page to help search engines better understand and index your pages.If the "Single Page Introduction" is left blank, the system will automatically extract some text from the page content to be used as an introduction.
  • Custom URLThis is a very practical feature that allows you to set a concise and meaningful URL address for a single page, for example, setting the URL of the "About Us" page to/about.htmlThis not only improves the user experience, but is also very beneficial for SEO. If left blank, the system will automatically generate a pinyin URL based on the page name.
  • Display order: You can set a number for the single page, the smaller the number, the higher the page is sorted in the list.
  • Single page templateThis is the key to implementing personalized display.You can specify a separate template file for a specific single page instead of using the default general template.contact.htmlTemplate.
  • Banner image and thumbnailThese fields allow you to upload attractive images for a single page. Banner images are usually used for visual display at the top of the page, while thumbnails may appear in the page list.
  • Single page contentThis is the main content of the page, you can use the rich text editor to edit it, which supports rich text formats, image, video insertion, and other functions.The AnQi CMS also supports Markdown editors, allowing you to write content in a more concise way and automatically render it as HTML, even supporting the display of mathematical formulas and flowcharts (extra configuration required).

Display single page content in the website front-end template

After creating a single page, the next step is to present them in your website's front-end template.AnQi CMS adopts syntax similar to Django template engine, making content calls simple.

1. Default and custom template

As a rule, Anqi CMS will automatically match templates for your single-page content. If you have not specified a custom template for a single page, the system will use the default one by default.page/detail.html(or in the case of flat mode'spage.htmlRender.

For example, if you set a "single page template" for a specific single page in the background.page/about.html),then the system will prioritize the template you specify. In addition, AnQi CMS also supports automatic template recognition based on single page ID or custom URL aliases, for examplepage/{单页面ID}.htmlorpage/{单页面URL别名}.htmlThis means you can customize the layout and style for each special page.

2. UsepageDetailTag call content

In the template file, you will mainly use to display the content of a single page and related imagespageDetailThis tag. This tag can obtain all the details of the current page.

Assuming you are visiting a single page, you do not need to specify an ID,pageDetailthe tag will automatically retrieve the data of the current page. If you need to call another single page with a specified ID, you can do so byid="XXX"ortoken="URL别名"Parameter to obtain.

Here are some common call examples:

  • Display page title:
    
    <h1>{% pageDetail with name="Title" %}</h1>
    
  • Display page description (summary):
    
    <p>{% pageDetail with name="Description" %}</p>
    
  • Display page main content:
    
    {% pageDetail pageContent with name="Content" %}
    <div class="page-content">
        {{ pageContent|safe }}
    </div>
    
    Important reminderWhen you callContentWhen a field contains HTML code (such as paragraphs, images, links, etc.), in order for the browser to correctly parse and display these HTML structures, you need to add|safeFilter. Otherwise, the page may display the original HTML tags instead of the rendered content.

Handle single-page images flexibly.

The display of images on a single page plays an important role in the visual presentation of a website. Anqi CMS provides three main image fields, allowing you to flexibly display according to your needs:

  • Single page thumbnail full image (Logo): Typically used to highlight the main visual image or important illustration of a single page.
  • Single page thumbnail (Thumb): A thumbnail version processed by the system, suitable for display in small areas such as lists, cards, etc., with faster loading speed.
  • Single-page slide group (Images)If you need to display multiple images as a carousel or image gallery on a single page, this field can come in handy.

It's also very simple to call these image fields:

  • Display the Logo image on a single page:
    
    <img src="{% pageDetail with name="Logo" %}" alt="{% pageDetail with name="Title" %}" />
    
  • Display the thumbnail on a single page:
    
    <img src="{% pageDetail with name="Thumb" %}" alt="{% pageDetail with name="Title" %}" />
    
  • Display the slide set image:due toImagesIt returns an array of image addresses, you need to useforloop to traverse and display them.
    
    {% pageDetail pageImages with name="Images" %}
    <div class="image-gallery">
        {% for item in pageImages %}
            <img src="{{ item }}" alt="{% pageDetail with name="Title" %}" />
        {% endfor %}
    </div>
    

Image optimization tips: AnQi CMS provides a powerful image optimization feature in the "Content Settings" section of the backend.You can configure whether to automatically download remote images, whether to enable WebP image format (to reduce image size), whether to automatically compress large images and thumbnails, and the processing methods and sizes.Reasonably utilizing these settings can significantly improve the loading speed and user experience of the website.


Enhance the SEO and user experience of a single page

In addition to content and image display, Anqi CMS also includes multiple features to help you optimize the search engine performance and user experience of a single page:

  • Customize the SEO value of the URLAs mentioned earlier, 'Custom URL' not only makes the link look more friendly, but also provides a clear page theme signal for search engines, which helps to improve the keyword ranking of the page.
  • 精细化控制 of TDK tags: Pass{% tdk %}Tags, you can accurately control each single page<title>/<meta name="keywords">and<meta name="description">content. For example, in<title>In the tag, you can choose whether to add the website name to maintain the conciseness or integrity of the title:
    
    <title>{% tdk with name="Title" siteName=true %}</title>
    <meta name="keywords" content="{% tdk with name="Keywords" %}">
    <meta name="description" content="{% tdk with name="Description" %}">
    
  • The powerful features of the content editor: The rich text editor of AnQi CMS allows you to easily format content and insert multimedia.If you are accustomed to using Markdown, simply enable the Markdown editor in the background "Global Settings" -> "Content Settings", and you can directly use Markdown syntax in the content of a single page, the system will automatically render it as HTML.render=trueManually control whether to render the parameter, for example{{pageContent|render|safe}}.

Through these flexible features, Anqi CMS makes the management and display of single-page content both efficient and full of possibilities. Whether it is a beginner or an experienced operator, everyone can easily create professional and attractive website pages.


Frequently Asked Questions (FAQ)

How to set different display styles for different single pages?You can achieve this in two ways: Firstly, by using the 'Page Management' section in the background, where you can fill in a custom template file path.

Related articles

How to display custom Banner images on AnQiCMS pages?

In website operation, skillfully using Banner images can not only beautify the page but also effectively convey information and guide user behavior.AnQiCMS as a flexible content management system, provides various ways to display customized Banner images, allowing you to configure them individually according to different pages and needs. ### Flexible Upload and Management of Banner Images Firstly, all images that are going to be used as banners need to be uploaded to the AnQiCMS media library.This is very simple, you can go to the 'Page Resources' menu in the backend

2025-11-07

How to use the pagination tags of AnQiCMS to control the display of list content?

In a content management system, how to effectively display a large amount of information without sacrificing user experience is always a question worth pondering.AnQiCMS provides a powerful and flexible pagination feature that allows website managers to finely control the display of list content, ensuring that the website is both beautiful and efficient.

2025-11-07

How to get and display the previous and next article links of AnQiCMS articles?

In website content operation, guiding users to smoothly browse related content is a key link to improving user experience and website depth.After a user finishes reading an article, if they can immediately see links to related or sequential previous and next articles, it will undoubtedly encourage them to continue exploring. This not only helps to reduce the bounce rate but also effectively improves the website's PV (page views) and SEO performance.AnQiCMS (AnQiCMS) is an efficient content management system that provides a very convenient way to implement this function.In AnQi CMS

2025-11-07

How to implement Markdown format content rendering and display on the AnQiCMS web page correctly?

In the digital age, the efficiency of content creation and publishing is the key to the success of the website.Markdown as a lightweight markup language, with its concise and efficient features, is increasingly favored by content creators.AnQiCMS knows this need, providing excellent Markdown support to users, making content creation more convenient, while ensuring that the web page presents a beautiful and clear structure.

2025-11-07

How to display category introduction, Banner image and thumbnail on AnQiCMS category page?

In website operations, the category page is not only an aggregation of content, but also an important entry for users to understand the website structure and explore specific topics in depth.A well-designed, informative category page that can significantly improve user experience and search engine optimization (SEO) effectiveness.AnQiCMS provides flexible features, allowing us to easily display category descriptions, banner images, and thumbnails on the category page, giving your website's category page a fresh look.Understanding AnQiCMS's category page and template structure In AnQiCMS

2025-11-07

How to filter and display AnQiCMS document list according to category ID and recommendation attributes?

Manage website content in AnQiCMS, often need to display document lists according to different conditions.Whether you want to display the latest articles of a specific category on the homepage or highlight some recommended content in the sidebar, the system provides flexible tools to help us achieve this.Today, let's talk about how to cleverly use category ID and recommendation attributes to accurately filter and display the document list you want.

2025-11-07

How to control the display sorting and pagination of AnQiCMS comment list?

In AnQi CMS, efficiently managing and displaying website comments is crucial for enhancing user interaction and optimizing content experience.The display order and pagination settings of the comment list directly affect the user's experience when browsing comments.This article will give you a detailed explanation of how to accurately control the sorting and pagination of comments in AnQiCMS. ### Understanding the Comment List Template Structure Firstly, we need to clarify the position of the comment list in AnQiCMS.

2025-11-07

How to use AnQiCMS tags to display categories and documents in the navigation menu?

In AnQiCMS, the website's navigation menu is not only an important entry for users to explore content and understand the website structure, but it is also a key for search engines to crawl and understand the website's hierarchical relationships.Using the powerful template tag feature of AnQiCMS, we can easily display categories and documents dynamically in the navigation menu, thus building a beautiful and efficient website navigation. ### One, prepare the background work: build the navigation skeleton Before delving into the template code, we need to make some basic configurations in the AnQiCMS background.In fact, the data that the front-end tags can retrieve and display

2025-11-07