AnQiCMS Help Document and User Guide
In website content management, we often need to display various numbers, especially floating-point numbers with decimal points.The way numbers are displayed, whether it is product prices, statistics, or calculation results, directly affects user experience and the accuracy of information.Inconsistent or inaccurate decimal places may cause the page to look cluttered, and even lead to misunderstandings in financial or precise measurement situations.
In AnQiCMS template design, the way data is displayed is crucial to user experience.Especially information such as dates and times, if presented in raw Unix timestamp format, is difficult for ordinary visitors to understand.Fortunately, AnQiCMS provides a very practical filter——`stampToDate`, which can help us easily convert these machine-readable number sequences into clear and friendly date and time formats.### Understand Unix Timestamp and `stampToDate` Filter First
In AnQi CMS template development, flexibly displaying dates and times is an indispensable part of content presentation.You may often need to present date information in the system or content in a specific format, such as "YYYY-MM-DD" or "MM/DD HH:MM" and the like.At this point, the `date` filter has become your powerful assistant.
In AnQiCMS template development, we often encounter situations where we need to handle various types of data.Sometimes, data obtained from a database or through user input, even if they represent numbers, may be treated as strings at the template layer.In this case, if direct mathematical operations or numerical comparisons are performed on these 'number strings', unexpected results or even errors may occur.Therefore, understanding how to convert a numeric string to an integer or floating-point number type in the AnQiCMS template is crucial for ensuring the accuracy of data processing and the correctness of logic
In website content operation, the display method and security of the content are equally important.AnQi CMS is an efficient content management system that provides comprehensive considerations for website security, among which the `escape` and `escapejs` filters are important tools for us to combat network attacks and ensure the correct display of content.Understanding their role can help us better manage and publish content.
During the template development process of Anqi CMS, the way content is displayed is flexible and diverse, and one of the very important filters is `safe`. Understanding the working principle of the `safe` filter, when to use it, and the security considerations it may bring, is crucial for building a website that is both functional and secure. ### The core function of the `safe` filter First, let's understand a basic security mechanism of the Anqi CMS template engine: the default automatic escaping.
In website operation, we often need to display text content containing rich formats and interactive elements, which is what we usually call rich text.This content may contain bold, italic, links, images, and even tables with HTML tags.How can one ensure that these HTML tags are rendered correctly in the AnQiCMS template while also taking into account the website's security, which is a topic worth discussing.### Understand the default security mechanism of AnQiCMS template Firstly, we need to understand one of the core security designs of the AnQiCMS template system: by default
In content operation, data analysis is an indispensable link.It can help us understand user behavior, evaluate content effectiveness, and guide future content strategy.AnQi CMS, with its flexible template engine syntax, provides us with powerful data processing capabilities, allowing us to perform some basic and practical data analysis directly at the template level.Among them, the `count` filter is like an efficient 'data detective' that helps us quickly understand the frequency of specific elements in the template data.Understand and make good use of this filter, it will greatly enhance our accuracy in content presentation and strategy formulation
In AnQiCMS daily operation and template design, we often need to decide how to display it based on the specific attributes of the content.For example, you may want to highlight articles that contain a certain keyword in the title, or adjust the style based on whether there is a specific phrase in the product description.How to determine whether a string contains another substring in a template has become a very practical skill.AnQiCMS's template system is based on the Django template engine syntax, providing a rich set of tags and filters to help us flexibly process data.for string inclusion judgment
In the AnQiCMS template, we often encounter some scenarios where we need to display some small, relatively fixed list data, such as the featured functions of a page, the advantages of a product series, or auxiliary navigation links, etc.The traditional method may require creating a special content model on the backend, then publishing several data items, and finally calling through template tags.But this seems a bit繁琐 for those data that do not change often and are limited in quantity.