AnQiCMS Help Document and User Guide
In Anqi CMS template design, we often encounter the need to integrate a series of data items into a coherent text.For example, we need to display multiple tags (Tag) in one place, or combine a set of custom parameter values obtained from the database.At this point, the `join` filter comes into play, which can efficiently concatenate the elements of an array into a string with the specified separator.### Understand `join`
In web template development, flexible handling of data types is the key to ensuring correct content display.We often encounter situations where we need to convert string data obtained from databases or external interfaces into numbers for calculation or formatting display.AnQiCMS (AnQiCMS) fully considers this requirement, providing two built-in filters `integer` and `float` to help users easily convert strings to integers or floating-point numbers, and intelligently handle conversion failure cases, thereby enhancing the robustness of the template.
In AnQi CMS template development, we often need to fine-tune the display of content, which includes flexible handling of string and array content.Understand and make good use of the various template filters provided by Anqi CMS, which can greatly enhance our ability to build dynamic and intelligent websites.Today, let's delve into a very practical filter——`index`, which can help us accurately locate the first occurrence of a keyword in a string or array.### `index` filter: A powerful tool for precise keyword positioning Imagine that
In the AnQi CMS template world, flexible handling and displaying data is a key link in content operation.When faced with the need to accurately extract a specific digit from a sequence of numbers, the `get_digit` filter is a very practical tool.It can help us achieve some detailed display requirements, such as grouping or highlighting based on the specific position of numbers. ### Core Function and Usage The main function of the `get_digit` filter, as the name implies, is to obtain a single digit from a number at a specific position.
In website content operations, accurately displaying numbers, especially floating-point numbers, is often a key factor affecting user experience and data professionalism.It is crucial to ensure that numbers are presented consistently and legibly in product prices, statistical data, or scientific reports.AnQiCMS (AnQiCMS) is well aware of this need, providing a powerful `floatformat` filter in the template engine to allow content creators to flexibly control the display precision of floating-point numbers.### `floatformat` filter
In AnQi CMS template development, in order to display content more efficiently and flexibly, we often use various filters to process the data.These filters are like various tools in a toolbox that can help us quickly format, cut, or extract data.Today, let's talk about two very practical and intuitive filters: `first` and `last`, and how they help us easily obtain the first or last element of a string or array.### 1. Getting to know the `first` and `last` filters Imagine that
During the template development process of AnQi CMS, flexibly handling and displaying data is the key to improving website functionality and user experience.Sometimes, the content we receive from the backend may be a single line string containing multiple pieces of information, such as a list of keywords, product tags, or a set of feature descriptions.If we need to treat this information as separate elements for processing or display, for example, as a list, we would need a method to split this single string into multiple independent items.At this time, the `fields` filter provided by the Anqi CMS template engine can come into play.
Master the `safe` filter in AnQiCMS templates: unlock the correct rendering and safety boundaries of HTML content AnQiCMS, as an enterprise-level content management system based on Go language, adopts syntax similar to Django template engine in template design, which provides great flexibility for content display.When building website content, we often need to display the information edited on the backend on the front-end page.
In AnQi CMS template development, how to balance flexibility and security when handling dynamic content is an important consideration.Amongst, the HTML automatic escaping mechanism (`autoescape`) plays a key role, which is aimed at preventing cross-site scripting (XSS) attacks, while also allowing us to display native HTML content when needed.Understand and master the usage of the `autoescape` tag, which will make your template creation more skillful.Understanding automatic escaping
It is crucial for the safety of output content in website operations.Especially when displaying user-submitted data or information obtained from external sources, if not properly processed, websites are easily vulnerable to cross-site scripting attacks (XSS) and other threats.AnQiCMS as a content management system that focuses on security, provides a powerful security escaping mechanism at the template rendering level, among which the `escape`, `e`, and `escapejs` filters are the key tools to ensure output security.AnQiCMS's template engine draws inspiration from Django