How to retrieve and display detailed content of a specific independent page?

Calendar 👁️ 84

Our Aiqi CMS offers great flexibility in content management, especially for pages that need to display independent, static information such as 'About Us', 'Contact Information', or 'Terms of Service'.These are called "independent pages" or "single pages", their content is usually relatively fixed, but they also need to be independently displayed and have search engine-friendly features.How can we efficiently retrieve and display the detailed content on these specific independent pages in AnQi CMS?This usually involves creating pages in the background and calling their content in the front-end template, these are the two main steps.


Create and manage independent pages

First, we need to create and edit these independent pages in the Anqi CMS backend system.After logging in, you can usually find the 'Page Management' feature under the menus related to 'Page Resources' or 'Content Management'.Here, you can add, modify, and delete independent pages like managing articles.

When adding or editing a standalone page, there are several key pieces of information that you need to pay attention to:

  • Page NameThis is the main title of the page, also the name displayed to the user on the front end.
  • Single page contentThis is the main content of the page, you can use a rich text editor or Markdown editor to enrich the content, including text, images, videos, and more.
  • Custom URL: To better optimize search engine optimization (SEO) and provide a clear page path, you can set a concise and clear custom URL alias for independent pages, such as setting the URL of the "About Us" page to/about.html.
  • Single page templateThis is a very powerful feature. Anqi CMS will apply a universal template to all independent pages by default (usuallypage/detail.html)。But if you want a specific page to have a unique layout or style, such as the “Contact Us” page that needs to include a map and a form, you can specify a custom template, such aspage/contact.html. The system will first look for the template file you specified, and if it does not exist, it will fall back to the default template.
  • SEO-related fieldsTo improve the search ranking of the page, you can fill in the SEO title, keywords, and description of the page in detail.
  • Visual elements: You can also upload exclusive Banner images and thumbnails for independent pages to enhance the visual appeal of the page.

With these detailed settings, your independent page is equipped with rich content and flexible display potential in the background.


Display independent page content in the front-end template.

After completing the backend settings, the next step is to display the detailed content of these independent pages in the website's frontend template.AnQi CMS provides concise and powerful template tags, making it very direct to call independent page content.

UsepageDetailRetrieve the details of a single page tag

pageDetailThe tag is specifically used to obtain detailed content of a single independent page.This tag is very flexible, it can retrieve information about the independent page currently being accessed, and can also retrieve the content of any independent page by specifying an ID or a custom URL alias.

If you want to display the title and main content of the current independent page in a page template, you can write the code like this:

<h1>{% pageDetail with name="Title" %}</h1>
<div class="page-content">
    {% pageDetail pageContent with name="Content" render=true %}
    {{ pageContent|safe }}
</div>

Herename="Title"It will get the title of the page, whereasname="Content"it will get the main content of the page. It should be noted that if the content of your independent page is written in Markdown format, you need toContentField plusrender=trueParameters so that the system can render it as HTML. At the same time, in order to ensure that the HTML content is displayed correctly rather than being escaped, we usually use|safefilter.

Sometimes, you may need to call information from a specific independent page at a fixed location on a website (such as the footer), such as displaying part of the 'About Us' page or its link. In this case, you can accurately retrieve it by specifying the page ID or a custom URL alias.

<p>
    了解更多关于我们的信息:
    <a href="{% pageDetail with name="Link" id="5" %}">{% pageDetail with name="Title" id="5" %}</a>
</p>

This code will retrieve the link and title of a standalone page with ID 5 and display it. You can also usetokenparameters, for exampletoken="about-us"assuming you have set up the "About Us" page in the backgroundabout-usAs a custom URL.

Display images and groups

Independent pages often require images to enrich the display. Anqi CMS provides the 'thumbnail (Logo)' and 'slideshow (Images)' fields for independent pages, and you can easily call them:

If you have set a single cover image for the page, you can useLogoField:

<img src="{% pageDetail with name="Logo" %}" alt="{% pageDetail with name="Title" %}">

If your page contains multiple images as slides or a gallery display, you can useImagesfield. Due toImagesIt returns an array of image addresses, you need to useforloop to iterate and display:

<div class="page-gallery">
    {% pageDetail pageImages with name="Images" %}
    {% for img in pageImages %}
        <img src="{{ img }}" alt="页面图片">
    {% endfor %}
</div>

Apply Custom Template

As mentioned earlier, by setting the 'single-page template' in the background, you can apply a dedicated template file to a specific standalone page. For example, if you create a page namedcontact.htmlthe template file and place it in the theme you are currently usingtemplate/your_theme_name/page/directory, then in the background set the 'Contact Us' page's 'Single Page Template' field tocontact.htmlThen when the user visits the "Contact Us" page, the system will automatically loadcontact.htmlto render content, thus realizing personalized page layout and functions

UsepageListtags list multiple independent pages

In addition to displaying the detailed content of individual independent pages, sometimes you may need to list all the independent pages in one place, such as in the footer navigation or sidebar of a website. At this time, you can usepageListTags:

<ul class="footer-nav">
{% pageList pages %}
    {% for item in pages %}
        <li><a href="{{ item.Link }}">{{ item.Title }}</a></li>
    {% endfor %}
{% endpageList %}
</ul>

This code will iterate over all published standalone pages and display their titles and links, which is very suitable for building static page navigation.

By using the above method, you can flexibly create, manage, and display detailed content of various independent pages in Anqicms, whether it is a simple text page, or a page containing complex text and images, even a custom layout page, all can be easily realized through the functions and template tags provided by Anqicms.


Frequently Asked Questions (FAQ)

Q1: How to make my 'Contact Us' page have a unique layout instead of using the default page template?A1: You can edit the "Contact Us" standalone page in the background, and fill in a custom template filename in the "Single Page Template" field (for example, `contact_us.html')}]

Related articles

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

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 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 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 display a list of all used tags (Tags) in the website?

In website operation, tags are an important tool for content organization and user discovery.A clear and complete list of tags can not only help users quickly find the content they are interested in, but also improve the website's SEO performance and guide search engines to better understand the structure of the website content.AnQi CMS provides powerful and flexible tag management and display functions, allowing you to easily display a list of all tags used on the website.### The display method of the site-wide tag list If you wish to establish a dedicated page on the website to showcase all used tags

2025-11-09

How to retrieve and display all articles associated with a specific tag?

AnQi CMS: Accurately locate and display the list of articles under specific tags In AnQi CMS, the Tag is a very practical feature that can help us classify and manage website content more finely, improve the efficiency of users discovering relevant content through keywords, and also greatly benefit the SEO performance of the website.By adding meaningful tags to articles, we can link together similar topics scattered across different categories, providing users with a more cohesive and in-depth reading experience.This article will delve into how to make use of the powerful template tag features of AnQi CMS

2025-11-09

How to dynamically set the page title (Title), keywords (Keywords) and description (Description)?

In website operation, the page title (Title), keywords (Keywords), and description (Description) are the foundation of Search Engine Optimization (SEO).They not only convey the core information of the page content to search engines, but also directly affect the click-through rate of users on the search results page.AnQiCMS (AnQiCMS) fully understands its importance and provides a flexible and powerful mechanism that allows users to dynamically and accurately set these SEO elements based on the content of different pages.This article will discuss in detail how to be efficient in AnQiCMS

2025-11-09

How to display the website name and logo in the template?

The website's name and logo, like a person's name and face, are an indispensable symbol.They are not only the core of the brand image, but also the key to improving the professionalism of the website, enhancing user trust, and making it easy to remember.In AnQiCMS, elegantly present these important identification elements in the website template, simpler and more flexible than you imagine.Understanding the basic settings of AnQiCMS website In AnQiCMS, the basic information of the website such as the name and Logo is concentrated in the background "Global Function Settings".You can log in to the back end and navigate to

2025-11-09