What is the core use of the `{% diy %}` custom content tag in AnQiCMS?

Calendar 👁️ 59

In AnQi CMS{% diy %}The core use and in-depth analysis of custom content tags

As an experienced website operations expert, I am well aware of the importance of a flexible and scalable content management system for the efficient operation of a website.AnQiCMS (AnQiCMS) stands out among many CMS products with its powerful customization capabilities.And within its rich template tag system,{% diy %}(Do It Yourself) Custom content tags are undoubtedly a core tool for achieving high website personalization and operational efficiency optimization.

Then,{% diy %}This seemingly simple label, what is its core function? In short, it provides a kind ofUnder the premise of not modifying the template code, define and call arbitrary custom text or link information from the backgroundThe mechanism. It goes beyond the fixed functions set by the system, giving operators great freedom, allowing them to centrally and conveniently manage those scattered contents throughout the website that may need frequent updates but do not belong to specific articles or products.

{% diy %}Beyond the preset, realize personalized content display

Anqi CMS provides such as{% system %}(System settings),{% contact %}Contact information and a series of built-in tags are used to call global information such as website name, phone number, and email address.These tags are indeed practical, but in the operation of a website, there will always be some special needs: such as placing a daily updated brand slogan at the bottom of the website, or displaying a social media link that does not belong to the regular contact information in a corner of a page, or a notice text that needs to be frequently adjusted during a promotional campaign.This information does not belong to the basic system configuration, nor does it classify as contact information, nor is it a specific field for an article or product. At this point,{% diy %}Labels become a way to solve such problems.

By using the "Global Function Settings" or "Contact Information Settings" area of the AnQi CMS backend, operators can create any number of custom key-value pairs according to their own needs.For example, you can define a parameter named "CompanySlogan" with the value "Let your creativity extend infinitely!"}Please define a parameter named "WeiboLink" with the value of your Weibo homepage link.Once these parameters are set up in the background, you can go through{% diy %}Labels easily call out their content. This greatly decouples the website content from the template structure, making content updates as simple as filling out a form.

Why{% diy %}So important? Analysis of practical scenarios.

{% diy %}The importance of tags is reflected in many aspects, especially for teams pursuing refined operation, its value is immeasurable:

  1. Flexible update of the core information of the website:The brand slogan of the website, partner list, festive greetings, urgent announcements, etc., these contents often need to be adjusted quickly. Use{% diy %}The operation personnel does not need to contact the technical team to modify the template file, they can directly update the parameter values in the background, which greatly shortens the response time.
  2. Integrate third-party service links or IDs:links to social media platforms (such as Facebook, Twitter, LinkedIn, etc.), or some third-party statistical codes, customer service system IDs, and so on, can be accessed through{% diy %}Manage uniformly. When a link changes or needs to be replaced with a service provider, it can also be modified with one click in the background, avoiding the麻烦 of searching and replacing one by one in the code.
  3. Personalized content display switch:Imagine that you may need to display a banner notification on the homepage during a special period. You can define a{% diy %}Parameters, such as "HomeBannerText", and determine in the template whether this parameter has a value or is a specific value to decide whether to display the banner.This, the display and hide of notifications can be easily controlled in the background.
  4. Differential configuration of multi-site content:If your AnQi CMS has deployed multiple sites,{% diy %}CombinesiteIdParameters can implement custom information with the same parameter name but different content across different sites, meeting the specific needs of multi-brand or multi-region operations.For example, different sites can have different customer service phone numbers or localized slogans.

it is just these practical scenarios that make,{% diy %}It is an indispensable tool for Anqi CMS template development and website operation, making the static part of the website come alive and respond more agilely to market changes.

How to elegantly use in the template{% diy %}

Use{% diy %}The tag is very intuitive, and its syntax structure is clear and straightforward. The basic format is: {% diy 变量名称 with name="字段名称" %}The field name is the parameter name you set in the Anqi CMS backend.

For example, if you add a custom parameter in the background global settings, named "CustomerServicePhone" (with the parameter value set to "400-123-4567"), then in your template, you can call it like this:

<p>24小时客服热线:{% diy customerPhone with name="CustomerServicePhone" %}{{customerPhone}}</p>

here,customerPhoneIs the temporary variable name you specified for this custom content, by{{customerPhone}}You can display the value '400-123-4567' in the template. If you do not want to declare an additional variable, you can also output directly:

<p>24小时客服热线:{% diy with name="CustomerServicePhone" %}</p>

In a multi-site environment, if you need to call custom parameters for a specific site, you can addsiteIdfor example:{% diy with name="CustomNotice" siteId="2" %}This will call the "CustomNotice" parameter value defined by the site with ID 2.

In practice, to ensure code readability and maintainability, it is recommended to{% diy %}The content called by the tag defines a meaningful variable name and combines it with HTML semantic tags for output.

{% diy %}The difference with other tags: clarify the boundaries.

In the Anqi CMS tag system,{% diy %}/{% system %}/{% contact %}and{% archiveParams %}they all involve data retrieval from the backend, but they have different core uses and data sources. Understanding these differences is the key to efficient operation.

  • {% diy %}with{% system %}/{% contact %}: {% system %}and{% contact %}The label is used to retrieve the Anqi CMS systemPredefined/Fixed fieldGlobal information, such as 'Website name', 'Record number', 'Contact number', etc, while{% diy %}is used to retrieve the operatorself-created/Unspecified fieldIs the global custom information. It can be understood as{% system %}and{% contact %}Is the standardized plug provided by the official{% diy %}And the one you customize or add as needed is the extended socket.

  • {% diy %}with{% archiveParams %}: {% diy %}Is obtainedgloballyInformation that is not attached to any specific content (such as articles, products), and{% archiveParams %}Tags are used to retrieveCustom fields defined under a specific content model (such as articles, products)These fields are associated with a specific article or product. For example, a product has custom parameters such as 'product model', 'manufacturing date', and these parameters need to be transmitted through{% archiveParams %}Call it, and it usually only takes effect on the product detail page.{% diy %}Not at all, it retrieves data that is universal to the entire website, or associated with the website itself rather than a specific content item.

In summary,{% diy %}The custom content tag is a microcosm of the highly customizable features of AnQi CMS, which greatly enhances the flexibility and operational efficiency of the website.By using it reasonably, operators can more conveniently manage and update unstructured, personalized information on websites, thereby better serving content marketing and brand promotion strategies.


Frequently Asked Questions (FAQ)

Q1:{% diy %}Tags and{% system %}/{% contact %}What are the main differences between tags? A1: {% system %}and{% contact %}The label is used to call the AnQi CMS system's preset, standardized field global information, such as "Website Name", "Website Record Number", "Contact Phone" and so on.{% diy %}The tag is used to call the global information parameters that you create yourself in the background "Global Feature Settings" or "Contact Information Settings" under the "Custom Parameter Settings".In simple terms, the former is a built-in standard feature, while the latter is a feature expanded by users based on personalized needs.

Q2: Can I use{% diy %}tags to call the custom fields I define for articles or products? A2: No.{% diy %}tags are used to call the websitegloballyCustom parameters, these parameters are unrelated to any specific article or product. If you need to call custom fields defined for content models such as products (such as the "model", "color", etc.), you should use{% archiveParams %}Tags, it is specifically used to obtain custom parameters for specific content items.

Q3:{% diy %}Which type of content is best managed by tags? A3: {% diy %}Tags are best suited for managing those

Related articles

How to ensure that all external social media links called by the `contact` tag open in a new window when clicked?

As an experienced website operations expert, I am well aware of the importance of website details for user experience and brand image.In content operation, we often need to guide users to visit external social media platforms to expand influence or provide more interactive channels.AnQiCMS (AnQiCMS) takes advantage of its flexible template tag system, making such operations intuitive and efficient.However, a common detail that is often overlooked is: How to ensure that these external links open in a new window or tab when clicked, thus avoiding users leaving your main site?Today, let's delve deeply into this issue

2025-11-06

Can I flexibly implement the `contact` tag of AnQiCMS to display multiple WhatsApp contacts on the page?

How to flexibly display multiple WhatsApp contacts in AnQiCMS?Unlock the advanced usage of the `contact` tag In today's global business environment, WhatsApp has become an important tool for efficient communication between businesses and customers.Whether it is for sales consultation, customer service, or specialized support for different products or regions, businesses may need to display multiple WhatsApp contact methods on their websites.The Anqi CMS is a powerful and flexible content management system that naturally also provides a convenient way to display contact information.

2025-11-06

What are the differences and similarities in the calling methods of links in templates for social media such as `Tiktok` and `Pinterest`?

As a senior website operation expert, I have a deep understanding of the design concept and actual operation of AnQiCMS in the social media link call aspect.Faced with increasingly important social platforms like `Tiktok` and `Pinterest`, AnQiCMS provides a set of efficient and flexible template calling mechanisms.Today, let's delve into the methods of calling social media links like Tiktok and Pinterest in AnQiCMS and how they differ from other platforms.--- Unlock Social Media

2025-11-06

How to display the YouTube channel link set in the AnQiCMS backend and ensure the validity of the link?

As an experienced website operation expert, I am well aware of the importance of gathering the brand's influence from various platforms to the official website.The YouTube channel as the core battlefield for video content marketing, the effective display and management of its link is particularly crucial in content management systems like AnQiCMS.Today, let's delve into how to set up and accurately display your YouTube channel link on the AnQiCMS backend.### Make your YouTube channel shine on the AnQiCMS website

2025-11-06

How to use the `{% diy %}` tag to display custom information configured on the back-end page?

As an experienced website operations expert, I fully understand how important the flexibility and update efficiency of website content are in the increasingly fierce online competition.AnQiCMS (AnQiCMS) with its powerful functions and friendly template system provides us with many operational tools.Today, let's delve into one of the very practical 'magic box' - the `{% diy %}` tag, and see how it helps us easily control the custom information of the front-end page, making website content operation more intelligent and efficient.

2025-11-06

How should the `name` parameter of the `{% diy %}` tag be set correctly to retrieve custom data from the backend?

AnQiCMS (AnQiCMS) is an efficient and flexible content management system, whose powerful custom functions are an important tool for website operators to improve efficiency and achieve personalized display.In daily content operation, we often encounter situations where we need to call back-end preset but non-standard field data, and the `{% diy %}` tag is exactly for this purpose.How should the `name` parameter of this tag be set to accurately obtain the custom data from the backend?Let's delve into it in depth.

2025-11-06

Under AnQiCMS multi-site management, how to accurately call the custom content of a specific site using the `{% diy %}` tag?

In the powerful ecosystem of Anqi CMS, multi-site management is undoubtedly one of its core highlights, giving enterprises the ability to operate multiple brands or sub-sites on the same platform.However, in the process of content operation, we often encounter such needs: how to flexibly call specific custom content from another sub-site in the template of the main site?At this point, the `{% diy %}` tag, combined with its clever `siteId` parameter, has become our powerful assistant in achieving this goal.

2025-11-06

If the custom content information is not set on the backend, what will the `{% diy %}` tag return on the front end?

AnQiCMS (AnQiCMS) with its flexibility and powerful customization capabilities has become the preferred tool for many enterprises and content operators.The `{% diy %}` tag is the key to displaying dynamic content, allowing us to customize various information in the background and present it on the website front end.What if the backend does not set a specific custom content, and the front end uses the `{% diy %}` tag to call it?As an experienced website operations expert, I am happy to delve deeply into this mechanism.### Understand `{%

2025-11-06