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

Calendar 👁️ 69

In AnQiCMS, the independent pages of a website play an important role, usually carrying core information such as 'About Us', 'Contact Information', 'Privacy Policy', and are an indispensable part of building website trust and improving the information architecture.This article will thoroughly introduce how to effectively manage and display these independent page lists in AnQi CMS.

Understand the 'independent pages' in Anqi CMS

In the context of Anqi CMS, what we refer to as 'independent page' corresponds to the 'single page' function in the system.These pages are different from articles, products, and other content models; they are usually independent, with relatively fixed content and not dependent on the classification system.The Anqi CMS provides an intuitive and convenient backend management interface, allowing you to easily create, edit, and maintain these single pages.

To manage these pages, you just need to log in to the Anqi CMS backend, navigate to the left menu's 'Page Resources', and then click 'Page Management'.Here, you can set independent titles, keywords, descriptions, custom URLs for each single page, and even apply different templates to specific pages to meet personalized display needs.

Get and display the core tags of independent pages:pageList

To display the list of single pages on the website front end, the Anqi CMS template engine provides a special tag:pageList. This tag helps you easily get all the published single page data and allows you to display its content in the template through a loop on the webpage.

pageListThe tag usage is very concise. It will default to fetching all single-page data under the current site.In most cases, you do not need to set complex parameters for it. If you are in a multi-site environment and need to retrieve a single-page list from other sites, you may need to use it in this casesiteIdThe parameter is used to specify the site ID. However, it is recommended to keep the default in most single-site scenarios.

When you use it in the template{% pageList pages %} ... {% endpageList %}this structure,pagesThe variable will contain an array of single-page objects. You can accessforLoop through this array and extract the detailed information of each single page for display.

Each single page (for example, in the loop of theitemVariables all provide the following commonly used data fields, you can flexibly call them according to the needs of website design:

  • Id: The unique identifier for a single page.
  • Title: The title of a single page, usually used as link text in lists.
  • Link: The access URL address of a single page.
  • Description: The brief description of a single page.
  • Content: Detailed content of a single page. Please note that when displaying this field, if the content contains HTML tags, it must be used.|safeFilter to ensure that HTML content is parsed and displayed correctly, rather than as plain text output.
  • Logo: Address of a large thumbnail for a single page.
  • Thumb: The standard thumbnail address for a single page.

Actual operation in the template: Display a list of independent pages

Let's go through a specific code example to see how to display a list of all standalone pages in your website template.This is very common in the navigation menu, footer link area, or site map of the website.

<nav class="page-list-nav">
    <ul>
    {% pageList pages %}
        {% for item in pages %}
        <li>
            <a href="{{ item.Link }}" title="访问{{ item.Title }}页面">
                {{ item.Title }}
            </a>
            {# 如果您希望在列表项中显示简要描述,可以取消以下行的注释 #}
            {# {% if item.Description %} <p>{{ item.Description }}</p> {% endif %} #}
            {# 如果页面配置了缩略图并想在列表中展示,可以这样添加 #}
            {# {% if item.Thumb %} <img src="{{ item.Thumb }}" alt="{{ item.Title }}缩略图" /> {% endif %} #}
        </li>
        {% endfor %}
    {% endpageList %}
    </ul>
</nav>

This code generates an unordered list where each list item is a link to an independent page, and the link text is the title of the single page.You can flexibly adjust the HTML structure and apply CSS styles according to the design style of your website, making it harmonious with the overall page layout.

Advanced techniques: Exclude specific pages and custom page templates

  • Exclude specific pages: Sometimes, you may not want all single pages to appear in the list, such as a page for internal access or a specific functional page. You canforAdd a conditional judgment inside the loop (ifExclude these pages. For example, if you want to exclude the page with ID 5:

    <ul>
    {% pageList pages %}
        {% for item in pages %}
            {% if item.Id != 5 %} {# 排除ID为5的页面,您也可以根据item.Title或其他字段进行判断 #}
            <li>
                <a href="{{ item.Link }}" title="{{ item.Title }}">{{ item.Title }}</a>
            </li>
            {% endif %}
        {% endfor %}
    {% endpageList %}
    </ul>
    
  • Custom single page template: SecureCMS allows you to specify an independent template file for a single page. For example, if you have a "About Us" page and want it to have a unique layout, you can select or create a named template in the page management backend.about-us.htmlYour exclusive template. When the user clicks on the link of this page, the system will automatically render the one you specifiedabout-us.htmlfile. The default single-page detail template of the system is usuallypage/detail.htmlOr customized according to the page IDpage/{单页ID}.htmlThis provides great flexibility for personalized page display

Summary

Anqi CMS features a concise and clear 'single-page' function and powerfulpageListThe template tag provides an efficient and flexible independent page management and display solution for us.Whether it is to build website navigation, bottom link area, or create other content modules that need to list independent pages, these tools can help you easily achieve this, thereby improving the user experience and information integrity of the website.

Frequently Asked Questions (FAQ)

  1. Q: Why didn't the list on the front page of the website display after I created a new single page in the background?A: First, please confirm that you have managed the page in the background

Related articles

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 the detailed content page of articles or products?

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 can effectively convey content value and enhance user experience and search engine friendliness.Strong and flexible tool set provided by AnQi CMS, allowing us to easily achieve these goals. ### The Foundation of Content: Content Model and Template Files In Anqi CMS, all articles and products are unified as "content" (archive). They can exhibit different forms

2025-11-09

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

Our Anqi CMS provides great flexibility in content management, especially for pages that need to display independent, static information, such as "About UsThese 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?

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