Filter filter
Template Tag Filter
-
Check if text or array contains a specified keyword
-
Remove all leading and trailing spaces, and specific characters from a string
-
Calculate the number of times a keyword appears in a line string and in an array
-
Filter: Split a line of text into an array by spaces
How to split a line of text into an array in AnQi CMS template?The fields filter can split a line of text into an array by spaces in the template.The defined array is a []string{}, which can be traversed and outputted later. -
Find the position of a keyword in a string or array row
How to get the position of a keyword in a line string or array in the Anqi CMS template?The index filter can calculate the position of a keyword in a string or array (array/slice).If a string contains multiple keywords to search for, the index returns the position of the first occurrence.If not found, return -1. -
Define an array in a template
How to define an array in the template of AnQi CMS?The list filter can be defined in the template.The defined array is a []string{}, which can be traversed and outputted later. -
Replace a specific keyword in a string with another keyword
How do I replace a word with another in a string in the AnQi CMS template?The replace filter can replace the old word with the new word in a string and return the new string.If old is empty, it will match at the beginning of the string and after each UTF-8 sequence.If new is empty, remove old. -
Specify repeated multiple output strings
How to repeat a string a specified number of times in the Anqi CMS template?The repeat filter can repeat a string a specified number of times. -
Add numbers or strings
Filter: Add Numbers or Strings -
Add a backslash before predefined characters
-
Convert English string letters to uppercase or lowercase
-
Center, left-justified, and right-justified string display by specified length
-
Remove specified characters from any position in a string
How to remove a specified character from any position in a string in the Anqi CMS template?The cut filter can remove the specified character from any position in a string. -
Display time values in specified format
How to display time values in a specified format in the AnQi CMS template?The date filter can display time values in a specified format.But note that the input for date must be a time.Time value; otherwise, it cannot be processed and an error will be reported.Output format is set according to the Golang time format.You can also use time, it has the same usage and result as date. -
Set default value for number, string, or object
-
Determine if a number can be a dividend
How to judge whether a number or its calculation result can be used as a divisor in an AnQi CMS template?The `divisibleby` filter can determine if a number or its calculation result can be a dividend.The filter will return a boolean value (bool), True means yes, False means no. -
Escape special characters in a string or JavaScript code
-
Split a line of text into an array by spaces
How to split a line of text into an array in AnQi CMS template?The fields filter can split a line of text into an array by spaces in the template.The defined array is a []string{}, which can be traversed and outputted later. -
The first or last value of a string or array
How to get the first or last value of a string or array in the AnQi CMS template?first Filter can get the first character of a string or the first value of an array.If the original string or array is empty, nothing is returned.If the string is Chinese, return the first Chinese character.The last filter can get the last character of a string or the last value of an array.If the original string or array is empty, nothing is returned. -
Decimal numbers are rounded to a specified number of decimal places
-
Get the number at a specified position in a number
How to get a specific number from a number in the AnQi CMS template?The 'get_digit' filter can obtain the digit at the specified position within a number, with the position counted from the end of the number, starting from 1.If the location to be obtained does not exist, return the entire number.If the original number is a number, the result obtained is the number obtained by subtracting 48 from the ASCII value of the character at that position. -
Convert a number string to a floating-point number or integer
How to convert a numeric string to a floating-point number or an integer in the AnQi CMS template?The float filter can convert a numeric string to a floating-point number.If the conversion fails, 0.0 is returned.integer Filter can convert string numbers to integers.If the conversion fails, it returns 0. -
Join array elements into a string with a specified separator
-
Get the length of a string, array, or key-value pair
-
Convert multi-line text to HTML tags with newline characters
How to convert multi-line text into HTML tags in AnQi CMS template?The linebreaks filter can convert multi-line text into HTML tags with line breaks.Every line should be wrapped with and, and there should be a blank line in the middle.The content can be processed using linebreaksbr. -
Translate mobile phone numeric keypad letters to numbers
How to convert the mobile phone number keypad letters to numbers in the Anqi CMS template?phone2numeric filter can convert letters on the mobile phone keypad to numbers. -
Plural form of a word
-
Return a random character from a string, array, or value
How to return a random character from a string or array in Anqi CMS template?The random filter can return a random character or value from a string or array. -
Remove HTML tags from HTML code
How to remove tags from HTML code in the AnQi CMS template?The `striptags` filter can remove all HTML tags from the HTML code.The 'removetags' filter can remove specified tags from HTML code. -
Parse and output HTML code without escaping
-
Extract an element from a string or array at a specified position
-
Split a string into an array by a specified delimiter
-
Format any value into a string and output it
How to format any value such as number, string, array, etc. into a string with a specified format in the Anqi CMS template?The stringformat filter can format numbers, strings, arrays, and other arbitrary values into strings according to a specified format. -
Extract strings or HTML code and add...
How to cut and add strings or HTML code in Anqi CMS template?The truncatechars filter can truncate and append strings... This method will truncate words, including the specified length...The `truncatechars_html` filter can truncate and append to HTML code ..., this method will truncate words, including the specified length ... -
URL parameter escaping
How to escape URL parameters in Anqi CMS template?The urlencode filter can escape URL parameters.The iriencode filter can escape URL parameters, except for /#%[]=:;$_&()+,!?All other characters, including `@'~`, will be escaped according to the URL parameter escaping scheme. -
Find and parse URL strings in text into clickable a tags
-
Count the number of words in a string
How to calculate the number of words in a string in AnQi CMS template?The wordcount filter can calculate the number of words in a string.word count will be separated by spaces.If it does not contain any spaces, it is considered a word.Returns an integer. -
Automatic line breaking for long text
-
Three states: OR, AND, NOT
-
dump filter: Print the structure type and value of variables
How to view the structure type of variables in AnQi CMS template?The dump filter can print out the structure, type, and value of a variable.