Security BLOG

AnQiCMS Help Document and User Guide

How to slice a string or array elements within a specified range using the `slice` filter?

The AnQiCMS template engine provides rich filters, giving you great flexibility in displaying content.Among them, the `slice` filter is a very practical tool that can help you accurately extract elements within a specified range of strings or arrays, whether you want to display an article summary, limit the number of images, or handle other data segments, it can be very useful.### The working principle of the `slice` filter The syntax of the `slice` filter is concise and clear: `{{ obj|slice:"from:to" }}`

📅 November 8, 2025 👁️ 79

How to search and replace specific keywords in the `replace` filter of the Anqi CMS template?

In the daily content management and template design of AnQi CMS, we often encounter scenarios where we need to search and replace specific content in strings.Whether it is to unify brand names, filter sensitive words, or adjust the display format of some text, manually modifying a large amount of content is undoubtedly cumbersome and inefficient.Fortunately, AnQi CMS provides a very practical template filter——`replace`, which can help us easily implement these string operations.### `replace` filter

📅 November 8, 2025 👁️ 67

How does the `repeat` filter output a string repeated a specified number of times?

During the process of website content creation, there are times when we have the need to output a specific string multiple times, such as for visual separation, placeholder content, and quick generation of list items.In the AnQiCMS template system, the `repeat` filter provides a very practical function that can help us complete this task efficiently.This filter, as the name implies, repeats a string according to the number we specify, thus saving the trouble of manual copying and pasting, greatly enhancing the efficiency and flexibility of template writing.###

📅 November 8, 2025 👁️ 67

How do the `removetags` and `striptags` filters remove specified or all HTML tags when processing HTML content?

In the daily content operation of AnQi CMS, we often encounter situations where we need to handle HTML content.To display plain text summaries in specific scenarios, or to standardize content output and enhance security, removing HTML tags is a common requirement.AnQi CMS provides two very practical template filters: `removetags` and `striptags`. They each have unique purposes and application scenarios, let us delve into how they help us efficiently clean HTML content.###

📅 November 8, 2025 👁️ 72

How to use the `random` filter in Anqie CMS template to randomly return a character or value from a string or array?

In AnQi CMS template development, sometimes we hope to add a touch of dynamism and surprise to the website content, so that visitors can see different elements each time they refresh the page.This is a very practical tool, the `random` filter.It can help us randomly select one from a set of predefined data to display, whether it is randomly selecting characters from a string or randomly selecting a value from an array (or list), it can be easily achieved.

📅 November 8, 2025 👁️ 65

How does the `phone2numeric` filter convert letters on a mobile phone's numeric keypad to the corresponding numbers?

In AnQiCMS template development, we often need to handle various data, and sometimes we may encounter some special situations with phone number input and display.For example, some phone numbers include letters (also known as "pretty numbers" or "vanity numbers", such as 1-800-FLOWERS) for ease of memorization or brand promotion.However, when dialing in practice, these letters need to be converted to the numbers on the corresponding number keypad.AnQiCMS provides a very practical built-in filter——`phone2numeric`, which helps us easily complete this conversion

📅 November 8, 2025 👁️ 122

How to define a string array variable directly in the template using the `list` filter?

AnQiCMS with its flexible and powerful template engine, provides great convenience for content display.When using templates for front-end development, we often need to handle various data, among which array variables are a common and practical data structure.Most of the time, we may need to define some fixed or temporary string arrays directly in the template, rather than passing them through backend code each time.Fortunately, AnQiCMS provides a very convenient `list` filter, making this operation extremely simple.### Core Function Analysis: `list`

📅 November 8, 2025 👁️ 68

How does the `linenumbers` filter add line number markers to each line of multiline text?

In website content display, sometimes we need to add line numbers to specific multi-line text content, such as code examples, step-by-step tutorials, or log information, to enhance readability and facilitate reference.AnQiCMS provides a simple and practical template filter `linenumbers`, which can help us easily achieve this function. ### The `linenumbers` filter's purpose The `linenumbers` filter is specifically used to automatically add line number markers to each line of multi-line text.It will start from the number 1

📅 November 8, 2025 👁️ 72

How do the `linebreaks` and `linebreaksbr` filters convert newline characters in multi-line text to HTML's `<p>` or `<br/>` tags?

When managing content in Anqi CMS, we often encounter such situations: when the multi-line text entered in the background editing box is displayed on the front-end page, it becomes a single line, or the newline characters are displayed as text.This is because the browser ignores single newline characters (`\n`) by default when rendering HTML.If you want the content to be displayed with paragraph breaks or line breaks like in the editing box, you need to rely on the powerful template filters provided by AnQiCMS, especially `linebreaks` and `linebreaksbr`

📅 November 8, 2025 👁️ 63

How to get the length of a string, array, or key-value pair in the `length` and `length_is` filters of the Anqi CMS template?

In Anqi CMS template development, it is often necessary to dynamically adjust the display of the page according to the length of the data content.Whether it is to truncate text, judge whether the list is empty, or perform simple content verification, understanding how to obtain the length of strings, arrays, or key-value pairs is the foundation of these functions.AnQi CMS provides the `length` and `length_is` filters, which can help developers flexibly handle these requirements.

📅 November 8, 2025 👁️ 68