Security BLOG

AnQiCMS Help Document and User Guide

How does the `add` filter work for adding numbers or concatenating strings in templates?

In AnQi CMS template design, we often need to perform some simple data processing, such as adding several numbers to display the total sum, or combining different text fragments into a complete sentence.At this time, the `add` filter is particularly convenient, as it is like a universal connector, capable of handling everything from arithmetic operations on numbers to the combination of text, making your template more flexible and dynamic.

Calendar date 2025-11-07 👁️ 72

How do the `removetags` and `striptags` filters remove specific or all HTML tags from HTML content?

In Anqi CMS, when managing website content, we often encounter such situations: articles imported from outside, comments submitted by users, or code generated by rich text editors may contain various HTML tags.These tags are sometimes necessary, but more often, they may disrupt the page layout, introduce unnecessary styles, and even pose potential security risks. 幸运的是,AnQiCMS provides two very practical template filters —— `removetags` and `striptags`

Calendar date 2025-11-07 78

In which scenarios must the `safe` filter be used to prevent HTML content from being automatically escaped?

When using AnQiCMS for website content management and template development, we often encounter a problem related to HTML content display: Why does the rich text content I edit in the background display as a pile of original code with angle brackets on the front end, rather than a beautifully formatted effect?This is actually the "auto-escape" mechanism of AnQiCMS template engine at work, and to solve this problem, the `safe` filter has become the key tool we must master.### Why does automatic escaping occur? AnQiCMS

Calendar date 2025-11-07 👁️ 70

How do the `urlize` and `urlizetrunc` filters automatically convert URLs in text to clickable links?

It is crucial to present information efficiently and aesthetically in website content operations.Especially when the content contains a large number of URLs or email addresses, manually converting them into clickable links is not only inefficient but also prone to errors.AnQiCMS (AnQiCMS) is well-versed in this, its template system provides the practical filters `urlize` and `urlizetrunc`, which can automatically identify URLs in text and intelligently convert them into clickable hyperlinks, greatly enhancing user experience and content management efficiency.###

Calendar date 2025-11-07 👁️ 75

How do the `truncatechars` and `truncatewords` filters control the truncation display of long text and add an ellipsis?

In website content operation, we often encounter such situations: In order to maintain the neatness and consistency of the page layout, we need to truncate the long text, such as in article lists or product summaries.If cut off simply and brutally, it may not only result in incomplete meaning of the text, but may also destroy the text structure containing HTML tags, affecting the aesthetics and functionality of the page.AnQi CMS, with its flexible template engine, provides us with an elegant solution to this problem.Through built-in text filters, we can easily control the display length of long texts and add ellipses at appropriate positions

Calendar date 2025-11-07 👁️ 79

How does the `slice` filter accurately extract the specified part of a string or array for display?

In the daily content management of Anqi CMS, we often need to accurately trim the text or data list displayed on the website to better adapt to different layouts, provide content previews, or optimize the user reading experience.At this point, the `slice` filter has become a very practical tool, which can help us flexibly extract the specified part of a string or array.### Core Function: Basic Usage of `slice` Filter The `slice` filter is like a tailor, capable of cutting according to the "scissors" position you provide

Calendar date 2025-11-07 👁️ 63

How `list` and `split` filters convert a string to an array and how to process it in a template?

In the powerful template system of Anqi CMS, flexible data processing is the key to building dynamic websites.At times, the data we retrieve from the backend, such as tags, keywords, or custom field values, may be stored as comma-separated strings, but we want to treat them as individual items in the frontend template.At this point, the `list` and `split` filters provided by Anq CMS are particularly important, as they help us convert strings into arrays, thereby enabling more refined control and display in templates.Why do we need to convert a string to an array

Calendar date 2025-11-07 👁️ 67

How to effectively use `if` and `for` tags for conditional judgment and data looping in AnQiCMS templates?

In AnQiCMS template development, `if` and `for` tags are undoubtedly the core tools for building dynamic content and flexible layouts.They allow us to display content based on specific conditions or efficiently loop through data, thereby transforming static templates into rich, user-responsive pages.AnQiCMS uses syntax similar to the Django template engine, making these operations intuitive and powerful.

Calendar date 2025-11-07 👁️ 63

How to dynamically generate a guestbook form with custom form field types using the `guestbook` tag?

It is crucial to provide a convenient user communication channel in modern website operations, and a message board is one of the efficient ways to do so.AnQiCMS (AnQiCMS) fully understands this need, through its powerful template tag system, especially the `guestbook` tag, allowing you to dynamically generate guestbook forms on your website flexibly, and easily customize form fields to meet various business scenarios.

Calendar date 2025-11-07 👁️ 66

How to display article comments using the `commentList` tag and integrate reply and like functions?

When building a vibrant website, the article comment feature is undoubtedly a core element to enhance user interaction and promote the development of a content community.AnQiCMS as an efficient and flexible content management system, provides us with powerful template tags, making it simple and intuitive to integrate and display comments.Today, let's delve into how the `commentList` tag in AnQiCMS helps us display article comments and cleverly integrate reply and like functions.

Calendar date 2025-11-07 👁️ 50