Displaying "About Us" or "Contact Us" single-page content in AnQiCMS is a very intuitive and flexible process.The system is designed to meet the needs of such static information display, through simple backend management and powerful template rendering capabilities, allowing you to easily create and beautify these important website pages.
Creating and managing single pages in the background
First, 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".This 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 to fill in.Among them, the "page name" is the title of the page and 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 in 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 can help search engines better understand and index your pages.Moreover, the "Custom URL" feature is particularly useful, allowing you to set a more semantically meaningful and friendly URL for the page, such as setting the URL for the "About Us" page to/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 thumbnail, the 'Banner image' and 'thumbnail' fields allow you to easily upload images.These images can be called in the template to add 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, usually located under the 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 contains 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, for examplepage/about.html. Make sure that this custom template file exists in your theme template directory, so that the system will prioritize it to render the single page, thereby achieving personalized display.
In the template file, to display the specific content of a single page, it mainly depends onpageDetailThe tag is used to retrieve the details of the current page. For example, to display the page title, 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 that,ContentIf the field contains HTML content, it needs to be配合|safeA filter to ensure that HTML code is parsed correctly rather than displayed as escaped. If your single-page content is written using a Markdown editor, AnQiCMS also supports the use ofpageDetailthe tag throughrender=trueThe parameter is converted to HTML.
Sometimes, you may need to list all important single pages, such as 'Terms of Service', 'Privacy Policy', and others, in the footer or other areas of the website. At this time,pageListTags come in handy. Through{% pageList pages %}You can get the list of all single pages, and then use the loop tag ({% for item in pages %}) to display their titles and links, making it convenient for users to navigate.
In summary, 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 a friendly content input interface on the backend, to a flexible template calling mechanism on the frontend, all are designed to help users build and maintain websites efficiently, ensuring that important information such as 'About Us' or 'Contact Us' can be presented to visitors in a state.
Frequently Asked Questions (FAQ)
How to set different template styles for different single pages?You can find the 'Single Page Template' field when editing single pages in the background, and fill in the path to your custom template file, for example
page/about.htmlorpage/contact.html. The system will prioritize the use of the specified template to render the page. Please make sure that the custom template file really exists in your website theme template directory (for example/template/您的主题名/page/) below.Does single-page content support Markdown formatting? If it does, how can it be displayed correctly on the front end?Yes, AnQiCMS supports Markdown format.You can enable the Markdown editor in the background "Global Settings" -> "Content Settings".Once enabled, when you use Markdown syntax in single-page content,
pageDetailThe tag is being calledContentfields will automatically convert them to HTML. In the template, you can use{% pageDetail pageContent with name="Content" render=true %}{{ pageContent|safe }}Indicate clearly how to render Markdown content as HTML.Can I list all single pages in the website navigation bar or footer?Of course you can. You can use
{% pageList pages %}Label to get all the single page lists created. Then, by a simpleforloop, you can iterate over thispagesvariable, get the title of each single page (item.Title) and the links(item.Link),and display them in the website's navigation bar, footer, or any other location where you wish to show them.