In AnQi CMS{% diy %}The core function of custom content labels deep analysis in English
{% diy %}(Do It Yourself) Custom content tags, undoubtedly are a core tool for achieving high website personalization and operational efficiency optimization.
So,{% diy %}What is the core function of this seemingly simple label? In short, it provides a kind ofDefine and call any custom text or link information flexibly from the backend without modifying the template codeThe mechanism.It goes beyond the fixed functions predefined by the system, giving operators great freedom. It allows the management of content scattered throughout the website that may need frequent updates but does not belong to specific articles or products, to be centralized and convenient.
{% diy %}: Go beyond presets to achieve personalized content display
The Anqi CMS provides such as{% system %}(System settings),{% contact %}(Contact information)等一系列内置标签,用于调用网站名称、联系电话、邮箱等预定义的全局信息。These tags are indeed practical, but in the operation of a website, one will always encounter some special needs: such as placing a brand Slogan that is updated daily at the bottom of the website, or displaying a social media link that does not belong to the regular contact methods in a corner of some page, or a public notice text that needs to be frequently adjusted during a promotional campaign.This information does not belong to the basic system configuration, nor is it categorized as contact information, nor is it a specific field of any article or product.{% diy %}The label has become a **way** to solve such problems.
Through the "Global Function Settings" or "Contact Information Settings" in the "Custom Settings Parameters" 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!”}]”;or define a parameter named“WeiboLink”with the value of your Weibo homepage link.{% diy %}Label the content easily. This greatly decouples the website content from the template structure, making content updates as simple as filling out a form.
Why{% diy %}So important? Analyzing practical scenarios
{% diy %}The importance of tags is reflected in many aspects, especially for teams pursuing refined operation, its value is immeasurable:
- Flexible update of the core information of the website:The brand slogan of the website, partner list, greetings for specific holidays, emergency announcements, etc., these contents often need to be adjusted quickly. Use
{% diy %},English personnel do not need to contact the technical team to modify the template file, simply update the parameter values in the background, which greatly shortens the response time. - 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, etc., can be accessed through
{% diy %}Perform unified management. When a link changes or needs to switch service providers, the same can be modified with one click in the background, avoiding the麻烦 of searching and replacing individually in the code. - Personalized content display switch:Imagine, you may need to display a banner notification on the homepage during a special period. You can define a
{% diy %}Parameter, such as “HomeBannerText”, and judge whether this parameter has a value or is a specific value in the template to decide whether to display the banner.So, the display and hide of notifications can be easily controlled in the background. - Differentiated configuration of multi-site content:If your security 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 numbers or localized slogans.
It is these practical scenarios that make,{% diy %}Becoming an indispensable tool in the development of AnQi CMS templates and website operations, it brings the static parts of the website to life, making it more agile in responding to market changes.
How to use elegantly in the template{% diy %}
Use{% diy %}The tags are very intuitive, and their syntax structure is clear and straightforward. The basic format is: {% diy 变量名称 with name="字段名称" %}. The field name is the parameter name you set when customizing parameters in the AnQi CMS backend.
For example, if you have added a custom parameter in the background global settings, named "CustomerServicePhone" (with the parameter value set to "400-123-4567"), then you can call it in your template like this:
<p>24小时客服热线:{% diy customerPhone with name="CustomerServicePhone" %}{{customerPhone}}</p>
Here,customerPhoneThis is the temporary variable name you specified for this custom content, through{{customerPhone}}The value can be displayed in the template as “400-123-4567”. If you do not want to declare an additional variable, you can also output it directly:
<p>24小时客服热线:{% diy with name="CustomerServicePhone" %}</p>
In a multi-site environment, if you need to call custom parameters of a specific site, you can addsiteIdParameter, for example: {% diy with name="CustomNotice" siteId="2" %}This will call the "CustomNotice" parameter value defined by the website with site ID 2.
In practical applications, it is recommended to write code for{% diy %}Label content definition defines a meaningful variable name and combines HTML semantic tags for output.
{% diy %}Differences from other tags: Clarify boundaries.
In the tag system of AnQi CMS,{% diy %}/{% system %}/{% contact %}and{% archiveParams %}all involve obtaining data from the backend, but their core functions and data sources are different. Understanding these differences is the key to efficient operation.
{% diy %}With{% system %}/{% contact %}:{% system %}and{% contact %}Tags used to obtain the safety CMS systemPredefined/Fixed fieldsGlobal information, such as "Website name", "Record number", "Contact number", etc., whereas{% diy %}is used to obtain the operatorself-created/Non-default fieldGlobal custom information. It can be understood as{% system %}and{% contact %}is the standardized power socket provided by the official{% diy %}while the extension power socket you add or modify according to your needs is.{% diy %}With{% archiveParams %}:{% diy %}is obtained.globallyInformation that does not depend on 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 bound to a specific article or product. For example, a "product" has "product model{% archiveParams %}Call it, and it usually only takes effect on the product detail page.{% diy %}Otherwise, it retrieves data that is universal to the entire website, or associated with the website itself rather than a specific content item.
In short,{% diy %}Custom content tags are a reflection of the highly customized features of AnQi CMS, greatly enhancing the flexibility and operational efficiency of the website.Through its reasonable use, operators can more conveniently manage and update unstructured, personalized information in websites, thereby better serving content marketing and brand promotion strategies.
Common Questions (FAQ)
Q1:{% diy %}Tags and{% system %}/{% contact %}What are the main differences between tags?
A1: {% system %}and{% contact %}Tags are used to call the global information of standardized fields preset in the security CMS system, such as “Website Name”, “Website Record Number”, “Contact Phone” and so on.{% diy %}The tag is used to call the "custom settings parameters" you have created yourself for non-preset fields in the "Global Feature Settings" or "Contact Information Settings" in the background.In simple terms, the former is built-in standard functionality, and the latter is functionality extended by the user based on personalized needs.
Q2:Can I use{% diy %}tags to call up the custom fields
A2:Cannot.{% diy %}tags for calling up the websitegloballyThe custom parameters, these parameters are unrelated to any specific article or product. If you need to call the custom fields defined for content models such as articles or products (for example, the product's "model", "color", etc.), you should use{% archiveParams %}The label, it is specifically used to get custom parameters of specific content items.
Q3:{% diy %}Which type of content is the label best suited for managing?
A3: {% diy %}Which ones are the labels best suited for managing?