AnQiCMS Help Document and User Guide
When building a website with AnQiCMS, we often need to fill dynamic content into the page template, which includes text that may come from user input.However, if not handled properly, the content entered by these users may be exploited by malicious attackers to plant malicious scripts, thereby triggering cross-site scripting (XSS) attacks.XSS attacks can steal user data, tamper with page content, even hijack user sessions, causing serious harm to websites and users.AnQiCMS as a content management system that focuses on security
During the template development process of AnQi CMS, we often need to deal with various data passed from the backend.AnQiCMS is a powerful content model with flexible tag system, which allows us to easily obtain articles, categories, pages, and even custom fields of data.However, when the data structure becomes complex, or when we are unsure of what content a variable contains, the efficiency of development debugging will be greatly reduced.At this moment, the `dump` filter acts like a powerful 'data perspective mirror', which can help us clearly understand these complex data structures
During the development and content operation of Anqi CMS templates, a deep understanding of the internal structure and specific values of variables in the templates is the key to efficient debugging.When you are faced with abnormal data displayed on a page or are unsure about the available properties of an object returned by a certain tag, being able to quickly view the detailed information of variables will undoubtedly greatly enhance the efficiency of solving problems. AnQi CMS provides a flexible and powerful template engine, which draws on the syntax of Django templates, and also includes some very practical debugging tools, allowing you to directly check variables in template files. Below
In AnQiCMS template creation, we often need to control the display of content based on some mathematical logic, such as determining whether a number can be evenly divided by another number.At this point, the `divisibleby` filter is particularly important.It helps us easily implement this judgment in the template without writing complex logic code.The `divisibleby` filter returns a very intuitive and easy-to-understand boolean value when performing mathematical integer division.This means that the result can only be two possibilities: `True` (true) or
During the development of AnQiCMS templates, we often encounter situations where we need to adjust the display of content or apply different styles based on specific conditions.For example, when a number in the list meets a certain rule, such as being divisible by 3, we would like it to have a special performance.Lucky enough, AnQiCMS's powerful template engine provides a simple and efficient way to meet this requirement.This article will deeply explore how to flexibly judge whether a number can be evenly divided by another number in the AnQiCMS template, and provide practical code examples in real-world scenarios.### Core Function
In AnQiCMS template development, we often need to handle the case where data may be empty to ensure the stability of page display and user experience.AnQiCMS provides rich template filters to meet such needs, where `default` and `default_if_none` are very practical tools for handling null values.They are both intended to provide a fallback value for missing or empty data, but there is a subtle yet critical difference in the definition of 'empty,' understanding these differences can help us more precisely control the template rendering logic.###
When using AnQiCMS to build a website, we often encounter such situations: some content fields may not have values every time, such as articles may not have thumbnails, products may not have detailed descriptions, or some contact information may not have been filled in.If variables that may be empty are directly called in the template, ugly blank spaces may appear on the page, or even program errors, which will greatly affect the user experience and the professionalism of the website.Luckyly, the AnQiCMS template system is based on syntax similar to Django and Blade, providing a powerful and flexible mechanism to handle these situations
In website content management, the accurate display of dates and times is crucial for improving user experience and ensuring the timeliness of information.AnQiCMS provides a flexible and powerful template engine, allowing you to easily customize the display of dates and times on web pages.Among many practical tools, the `date` filter is an important member for handling date and time formatting.### `date` filter: A powerful tool for formatting date and time The `date` filter in AnQiCMS templates is used to format `time.Time`
In website content operation, the way dates and times are presented often directly affects user experience and the clarity of information.A professional, readable date format can not only enhance the credibility of the content, but also allow visitors to obtain key information faster.AnQiCMS as a powerful content management system naturally also provides a flexible way to handle and format date and time.When we need to display the publication time, update time, or any other date information in the AnQiCMS template, we may encounter a problem
In website content operation, we often encounter scenarios where we need to process string data.For example, the title, description, or keywords extracted from the database may contain extra spaces, unnecessary special characters, or even inconsistent prefixes or suffixes.These characters may not only affect the aesthetic beauty of the layout, but may also cause interference when performing data analysis or search engine optimization (SEO).AnQiCMS as an efficient content management system, deeply understands the needs of users in content processing.