AnQiCMS Help Document and User Guide
With the popularity of mobile internet, the types of devices used by users to access websites are increasingly diverse, ranging from desktop computers to tablet computers, and various sizes of smartphones. Whether the content of a website can be displayed smoothly and beautifully on different devices has become an important standard for evaluating the quality of a website.AnQiCMS (AnQiCMS) was designed with this need in mind, offering flexible and diverse solutions to ensure that website content can easily achieve adaptive display on multiple devices.
When using AnQiCMS for website content management, image management and optimization is a key factor in improving user experience, accelerating page loading speed, and enhancing SEO performance.Especially in the process of template development, we often encounter the need to obtain addresses of different size thumbnails.AnQi CMS provides a straightforward way to handle these issues with its concise and efficient design concept.Today we will delve deeply into how to cleverly use built-in filters in AnQiCMS templates to obtain different thumbnail addresses for the images we upload
In AnQi CMS template development, we often need to display different text in a user-friendly manner on the front page according to the boolean (true/false) status of background data, such as "yes" or "no."}Directly displaying `true` or `false` may seem too stiff, and writing complex `if-else` judgment statements can make template code look lengthy.Fortunately, AnQiCMS provides a simple and efficient solution - the `yesno` filter, which can help us easily convert boolean values to custom text states
In daily content operations, we often encounter such a scenario: when long English paragraphs are published, they may exceed the container width on different devices or screen sizes, causing horizontal scroll bars to appear, which greatly affects the user's reading experience and the beauty of the page.AnQiCMS (AnQiCMS) fully understands this pain point and has provided a very practical template filter - `wordwrap`, which can cleverly solve the problem of automatic line breaking for long text.
In Anqi CMS template design, the `wordcount` filter is a practical tool used to count the number of words in the text.For operation personnel and content creators, understanding the working principle, especially the statistical logic when dealing with mixed Chinese and English text, can help us accurately assess content length, optimize article structure, and better meet the needs of search engine optimization (SEO) and user reading experience.### `wordcount` filter basic usage The `wordcount` filter is very straightforward to use
When building dynamic links in the AnQiCMS template, we often need to pass variables as query parameters in the URL.For example, a search results page may need to pass the user's search term as a parameter;A category filter page may need to include the selected category ID or multiple filter conditions.However, these dynamic contents often contain special characters, such as spaces, `&`, and `?`Backticks, equals, slash, hash, etc., they have specific meanings in URLs.If these special characters are not processed, the browser or server may not be able to correctly parse the URL, resulting in a page error
In AnQi CMS template design, we often need to process the displayed data to ensure that the content presented to the user is both beautiful and accurate.Among them, string processing is an indispensable part of content operation.AnQi CMS provides a series of flexible filters that help us easily complete these tasks, and the `trim` family of filters is one of the very practical ones. At first, we might think that the `trim` filter is mainly used to remove whitespace characters from the beginning and end of a string, such as extra spaces or newline characters.
In daily website operations, we often encounter the need to display or calculate user input data on the webpage.Even when fields are explicitly set as numeric types in the background, when the data is fetched to the front-end template for rendering, they are often in the form of strings.This is not a problem when displaying simple content, but once it involves numerical calculations, such as calculating the total price, calculating percentages, etc., direct string operations can lead to unexpected results and even errors.
In AnQiCMS template development, the flexibility of data display is often the key to determining user experience and the professionalism of content presentation.Among them, the `stringformat` filter is undoubtedly a powerful tool that allows us to finely format various data types to meet advanced needs from simple numerical precision control to complex percentages, scientific notation, and other advanced requirements.
In Anqi CMS template design, flexibly displaying and managing images is an indispensable part of building a high-quality website.When the content contains multiple images, such as group images on product detail pages or article illustrations, we often need to accurately extract one of the images, such as using the first image as a thumbnail or cover, or obtaining the last image for special display.This article will discuss in detail how to easily obtain the address of the first or last image in the image array of the AnQiCMS template.