How to create and display custom single-page content (such as About Us, Contact Information)?

Calendar 👁️ 79

In website operation, content such as 'About Us', 'Contact Information', and 'Privacy Policy' is usually displayed in the form of independent pages. This content is relatively fixed and plays an important role in the website structure.AnQiCMS provides an intuitive and powerful function for creating and managing these custom single-page websites, allowing you to easily publish and update without writing code.

Create custom single-page content

Creating a single page in AnQi CMS is a simple and direct process. First, you need to log in to the back-end management interface.

  1. Enter Page Management:Log in to the AnQi CMS backend, find the "Page Resources" option in the left navigation bar, expand it, and select "Page Management".This will list all the single pages created, you can add, edit, delete, and other operations.

  2. Add a new page:Click the 'Add Single Page' button to enter the page editing interface. You will see a series of fields that need to be filled out, which together make up the content and related configuration of your single page.

    • Page name:This is the title of a single page, which is also the main name displayed on the front end, such as 'About Us', 'Contact Us'.
    • Custom URL:This is a very important setting that determines the URL format of your single page.The AnQi CMS will automatically generate a pinyin URL alias based on the page name you enter, for example, “About Us” may generate “guanyu-wome.html”.If you are not satisfied with the automatically generated URL, you can manually edit it to a more concise and descriptive English or Pinyin combination, such as 'about-us' or 'contact'.Custom URLs not only make website addresses more aesthetically pleasing, but also help with search engine optimization (SEO), but make sure it is unique throughout the site.
    • SEO title, keywords, description:To improve the single-page performance in search engines, it is recommended that you fill in these SEO-related fields carefully.The SEO title will be the title of the page in the browser tab and search results, the keywords are the words you want the page to be searched for, and the summary is the content abstract below the title in the search results.
    • Single page content:This is the main part of a single page. Anqi CMS provides a rich text editor with various features, allowing you to edit text, insert images, add links, and even embed videos like using Word.If you are familiar with Markdown syntax, Anqi CMS also supports Markdown editors, making content formatting more convenient.
    • Single page template: By default, Anqi CMS will use a name calledpage/detail.htmlThe general template is used to render all single pages. If you want a single page to have a unique design or layout, you can specify a custom template file for it.For example, if you designed a page namedabout.htmlThe template file (usually located in the template directorypage/folder), just fill in hereabout.htmland it is. The system will prioritize loading the template you specify
    • Other optional settings:You can also set the page display order according to your needs, upload a "Banner image" for the top visual display of the page, or set a "thumbnail" for use in the page list or sharing.

Fill in and save, your custom single page will be created.

Display custom single page content

After the single-page content is created, how to display it on the website front-end is the key step. Anqi CMS provides various flexible ways.

  1. Access directly through the URL:The most direct way is to access it through its custom URL. For example, if you set the custom URL of the "About Us" page toabout-usthen users can access it through您的域名/about-us.htmlThe page was accessed. By default, AnQi CMS will use the template package you are currently using.page/detail.htmlFile to parse and display the content of the page. If you specified a custom template (such asabout.html), the system will automatically load the file for rendering.

  2. Call the content of the specified page in the template:Most of the time, you may need to display part of a specific page on other pages of the website (such as the homepage sidebar or footer), or link to these pages in the navigation menu. Anqi CMS provides convenient template tags for this:

    • pageDetailLabel (Get details of a single page):If you want to display the details of a specific single page in a template, you can usepageDetailLabel. For example, display a short introduction of the "About Us" page on the homepage:

      {% pageDetail aboutPage with id="1" %} {# 假设“关于我们”的页面ID是1,或者您可以使用 token="about-us" #}
          <h3>{{ aboutPage.Title }}</h3>
          <p>{{ aboutPage.Description }}</p> {# 显示页面的简介 #}
          <a href="{{ aboutPage.Link }}">了解更多</a>
      {% endpageDetail %}
      

      Or, if you are on the template of the current single page, directly obtain the content of the current page:

      <h1>{{ pageDetail with name="Title" }}</h1>
      <div>{{ pageDetail with name="Content" | safe }}</div>
      {# 注意:pageDetail with name="Content" 后通常需要使用 | safe 过滤器来解析HTML内容,否则可能会原样输出HTML标签。 #}
      

      pageDetailThe tag can retrieve various fields on a single page, such asId(ID),Title(Title),Link(Link),Description(Description),Content(Content) and so on.

    • pageListTag (to get a list of multiple pages):If you need to list all single-page or partial single-page links in a certain area of the website (such as the footer or sidebar),pageListtags are very suitable.

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

      In this way, you can easily build a single-page navigation list.

  3. Add a single-page link to the navigation menu:The most common practice is to add single pages such as 'About Us', 'Contact Information', and others to the top or bottom navigation menu of the website.In the Anqi CMS backend, under 'Background Settings' -> 'Website Navigation Settings', you can select the 'Category Page Link' type, and then choose the single page you want to add to the navigation menu.Thus, when the user clicks on the navigation item, they can directly jump to the corresponding single page.

By following these steps, whether it is the creation of content, the selection of display methods, or the integration of website structure, Anqi CMS provides you with clear and flexible solutions, making the operation of custom single-page pages efficient and convenient.

Frequently Asked Questions (FAQ)

How to set different template styles for the "About Us" and "Contact Information" pages?You can specify a different template filename for each page when creating or editing a single page in the 'Single Page Template' field. For example, fill in the 'About Us' pageabout.html,“Contact Information” page filled incontact.html. The system will automatically load the corresponding template files when rendering these pages. Of course, you need to ensure that these customizedabout.htmlandcontact.htmlThe file already exists in your current template directory.page/In the subfolder.

2. Does the content of a single page support Markdown format?Yes, Anqi CMS is built-in with Markdown editor support.

Related articles

How to add and display dynamic breadcrumb navigation on a webpage?

In modern web design, breadcrumb navigation plays a crucial role.It is like a 'footprint' of the user on the website, clearly showing the position of the current page in the overall website structure, making it easy for visitors to understand, thereby greatly enhancing the usability and user experience of the website.At the same time, a reasonably set breadcrumb navigation also helps search engines better understand the structure of the website, which is very beneficial for SEO optimization.For users who use AnQiCMS to manage websites

2025-11-08

How to precisely control the display content, level, and selected status of a website navigation menu?

Website navigation, like a signpost of a website, a clear and intuitive navigation system can greatly enhance the user experience and help visitors quickly find the information they need.At the same time, a good navigation structure is also crucial for search engines to understand the hierarchy of website content, to effectively crawl and rank.In AnQi CMS, we can flexibly and accurately control the display content, level, and selected status of the website navigation, making it both beautiful and practical.

2025-11-08

How to display the global TDK (Title, Keywords, Description) information of the website?

## Optimizing Website Front: Display and Application of TDK Information in AnQi CMS In website operation, TDK (Title, Keywords, Description) is an indispensable basic element for Search Engine Optimization (SEO).They are like the 'business card' of a website, directly telling search engines about the theme, core content, and most important keywords of your page, thereby affecting the ranking and click-through rate in search results.

2025-11-08

How can I display the list of articles under the category page and also show the category's Logo or Banner image at the same time?

Managing and displaying categories in Anqi CMS is a key step in building a well-structured, user-friendly website.The category page not only helps users find the content they are interested in quickly, but also, with the help of carefully designed visual elements such as logos or banner images, it can effectively enhance the brand image and user experience.This article will detail how to implement these functions on the category page of Anqi CMS.

2025-11-08

How to retrieve and display the contact information configured on the website backend (such as phone number, address, social media links)?

It is crucial to display a company's contact information clearly and conveniently in website operations, as it not only enhances customer trust but also serves as a direct way for users to obtain services and consult.AnQiCMS (AnQiCMS) is a powerful content management system that provides intuitive backend configuration options and flexible template calling mechanisms, allowing you to easily manage and display this information.Next, we will explore how to configure and display your website's contact information in AnQiCMS, including phone number, address, social media links, and more.--- ## First Part

2025-11-08

How to get and display the current year in a template for dynamic content such as copyright information?

When operating a website, we often need to display the current year in the footer copyright statement, for example, “© 2023 All Rights Reserved.”. With the passage of time, this year needs to be updated annually, and if manually modified, it is undoubtedly a repetitive and easily overlooked task.AnQi CMS fully considers this common demand and provides a very intuitive and powerful template tag that allows you to easily realize the dynamic display of years, keeping your website's copyright information always up to date.###

2025-11-08

How can AnQi CMS protect the copyright of original content through anti-crawling and watermark features when displayed?

On a day when digital content is increasingly abundant, the value of original content is self-evident, serving as the cornerstone for attracting users and building brand images on websites.However, the issues of content theft and malicious collection that follow also make countless creators and operators headache.Hardly written articles, carefully designed images, may be borrowed by others in a moment, even copied and pasted directly, which not only severely打击s the original enthusiasm, but also actually harms the intellectual property rights.For website operators, original content is the core competitiveness of the website.

2025-11-08

How to define and temporarily store variables in a template for easy content display and reuse?

When building a website, we often encounter situations where we need to repeat certain information or adjust content flexibly according to different contexts.If each time is hard-coded, it is not only inefficient but also quite麻烦 to maintain later.AnQiCMS (AnQiCMS) fully understands this, its template system provides various flexible ways to define and temporarily store variables in templates, thus achieving convenient display and efficient reuse of content.Why do you need to define and store variables in templates?

2025-11-08