Displaying "About Us" or "Contact Us" single-page content in AnQiCMS is a very intuitive and flexible process.The system is designed to meet such static information display requirements, allowing you to easily create and beautify these important website pages with simple backend management and powerful template rendering capabilities.
Create and manage single pages in the background
Firstly, all single-page content needs to be created and managed in the AnQiCMS backend.After entering the background management interface, you will find a module named "Page Resources", click to enter and select "Page Management".Here is the core area where you create, edit, and delete all single pages.
When you click 'Add Single Page', you will see a series of fields that can be filled in.The "Page Name" is the title of the page, which will be displayed on the website front-end.The core content of the page is input through the 'Single Page Content' editor, which is feature-rich and supports rich text editing, allowing you to format text and images as you would with Word.
For Search Engine Optimization (SEO), AnQiCMS also provides comprehensive considerations.You can set the 'SEO title', 'keywords', and 'page description' separately for each single page. This information helps search engines better understand and index your pages./about-us.htmlThis not only improves user experience, but also benefits SEO. By default, the system will automatically generate a pinyin URL based on the page name, of course, you can also manually modify it as needed.
If your single page needs some visual elements, such as a top banner or small images, the "Banner image" and "Thumbnail" fields allow you to easily upload images.These images can be called in the template, adding more design sense to the page.
Flexible display of single-page content
The strength of AnQiCMS lies in its template rendering mechanism. For single-page applications, the system provides a set of default template files, which are usually located under your current theme.page/detail.htmlThis means that as long as you create a single-page in the background, it will automatically apply this default template for display.
However, if your 'About Us' page requires a unique layout, or if the 'Contact Us' page includes special form styles that differ from the default template, AnQiCMS also provides great flexibility. When editing a single page, you will see a 'Single Page Template' field, where you can specify a custom template file, such aspage/about.html. As long as you ensure that this custom template file exists in your theme template directory, the system will prioritize its use to render this single page, thereby achieving personalized display.
In the template file, to display the specific content of a single page, it mainly depends onpageDetailLabel. This label is specifically used to obtain the detailed information of the current page. For example, to display the title of the page, you can use{% pageDetail with name="Title" %}; to display the main content of the page, you can use{% pageDetail pageContent with name="Content" %}{{ pageContent|safe }}It is worth noting,ContentThe field needs to be paired with HTML content|safeFilter to ensure that HTML code is parsed correctly instead of being escaped and displayed. If your single-page content is written using a Markdown editor, AnQiCMS also supports editing in Markdown.pageDetailTags throughrender=trueParameters to convert it to HTML.
Sometimes, you may need to list all important single pages in the footer or other areas of the website, such as "Terms of ServicepageListThe tag comes in handy. Through{% pageList pages %}, you can get all the list of single pages, then use the loop tag ({% for item in pages %}) to display their titles and links, making it convenient for users to navigate.
In short, whether it is content editing, SEO optimization, or front-end display, AnQiCMS provides a comprehensive solution for the creation and management of single-page websites.From the friendly content input interface in the background to the flexible template calling mechanism in the frontend, all are aimed at helping users efficiently build and maintain websites, ensuring that important information such as 'About Us' or 'Contact Us' can be presented to visitors in a**state**.
Common Questions (FAQ)
How to set different template styles for different single pages?You can find the 'Single Page Template' field when editing a single page in the background, and fill in the path of your custom template file, for example
page/about.htmlorpage/contact.htmlThe system will prioritize using the specified template to render the page. Please make sure that this custom template file indeed exists in your theme template directory (for example/template/您的主题名/page/).Does single-page content support Markdown format? If it does, how can it be displayed correctly on the front-end?Yes, AnQiCMS supports Markdown format.You can enable Markdown editor in the "Global Settings" -> "Content Settings" on the backend.
pageDetailTags in the callContentField will automatically convert it to HTML. In the template, you can use{% pageDetail pageContent with name="Content" render=true %}{{ pageContent|safe }}autoautoauto
{% pageList pages %}Label to get all the single page lists created. Then, through a simpleforloop, you can iterate over thispagesvariable, get the title of each single pageitem.Title)and link(item.Link),and display them in the navigation bar, footer, or any other location you wish to show.