Set contact information for AnQi CMS: easily add custom fields to meet your unique needs
In website operations, an efficient and personalized way of displaying contact information is often the key to building trust and promoting conversion between enterprises and users.AnQi CMS knows this, its powerful customizability allows you to easily exceed default settings, add exclusive contact fields to your website, and ensure that your site perfectly fits the unique needs of your business.
AnQi CMS is an efficient and customizable enterprise-level content management system, which not only provides rich content models and SEO tools, but also demonstrates its flexibility in detail.For such fundamental and important information as contact information, the system allows us to customize it deeply.
Why do you need custom contact fields?
In actual operation, the standard contact phone number, email and address may not cover all your communication channels.Maybe your business needs to display specific instant messaging tools, such as Telegram, Line ID;Or list international fax numbers, online customer service links;Or, to better serve global users, you may want to add multi-language customer service contact information, even social media accounts (such as WhatsApp, Facebook Messenger ID) so that users can easily reach out.The customized contact field function of AnQi CMS is exactly designed to meet these diverse needs.
How to add a new custom contact field in AnQi CMS?
The entire process is intuitive and easy to operate, even if you are not a professional developer, you can easily complete it.
First, please log in to the Anqi CMS admin interface. After logging in, we need to find the area responsible for managing the website contact information. This is usually located in the left navigation bar.Backend settingsUnder the menu, click to expand and selectContact information settingsJust do it.
On the 'Contact Information Settings' page, you will see that Anqi CMS provides a series of commonly used contact information fields by default, such as contact person, phone number, contact address, email address, WeChat ID, and WeChat QR code.These fields cover most of the basic needs of websites.
However, our goal is to add a new custom field. Please note a field namedCustom settings parametersThe region. This is where we exert our customized magic.
Add custom parameters:In the "Custom Settings Parameters" area, you will find the entry point to add a new field.There will usually be an “Add” button or provide a new row directly in the table.Click it, you will see three key input items: Parameter Name/Parameter valueandNote.
Define parameter name (Template Call Name):This is the unique identifier you use when calling this custom field in the website template.It is strongly recommended to use English words or pinyin as parameter names to maintain code neatness and maintainability.The Anqi CMS system will automatically convert it to CamelCase, for example, if you enter
skype_idIt will be represented in the template asSkypeIdThe form is called. Choosing a clear, descriptive name is crucial as it helps you and your template developers quickly understand the purpose of the field.Set parameter value (Content/Value):This field is used to store the specific content of the custom contact information. For example, if your parameter name is
SkypeIdThen, fill in your Skype account as the parameter value; if it isInternationalFaxFill in the international fax number. The information that users see on the front page is what is filled in here.Enter a note (Internal Description):The remark field is used to help you better understand the purpose of this custom parameter.It will not be displayed on the front end, purely for clarity during backend management and for ease of future maintenance.For example, you can fill in the 'Enterprise Skype Online Communication Account' or the '24-hour international fax service hotline'.
Save changes:After filling out, please be sure to click the bottom of the pageSaveButton, ensure your changes take effect.
Integrate custom fields into the website template.
It is not enough to add custom fields in the background, in order to display this information on your website, you also need to integrate it into the website template. Anqi CMS provides simple and powerfulcontactTag to get this contact information.
You just need to use it in the template (usually in the footer, contact us page, or sidebar, etc.).{% contact %}Label, and throughnameSpecify the parameter name you just created.
For example, if you created a namedSkypeIdThe custom contact field, and you want to display it on the website, you can call it in the template file like this:
{# 获取Skype ID并直接显示 #}
<p>Skype 联络:{% contact with name="SkypeId" %}</p>
{# 如果您希望将Skype ID赋给一个变量再使用,可以进行条件判断 #}
{% contact mySkypeId with name="SkypeId" %}
{% if mySkypeId %}
<p>我的Skype账号是:<a href="skype:{{ mySkypeId }}?chat">{{ mySkypeId }}</a></p>
{% endif %}
Please note that if your "parameter value" may contain HTML code (such as a full paragraph containing a link), remember to add it when calling the template.|safeA filter to ensure that the content is parsed correctly rather than escaped. For example:<div>{% contact with name="CustomHtmlInfo" %}|safe %}</div>.
Operations Tips
- Keep parameter names concise and clearThis makes it easier to remember and makes template calls more intuitive.
- Thorough testingAfter modifying the template, be sure to check the new contact field on the front page to ensure that it is displayed correctly and that its format and functionality meet expectations.
- Consider responsive designIf your website supports mobile, make sure the new contact information can be displayed and operated well on various devices, such as clickable phone numbers and one-click communication ID.
Through the contact information setting of AnQi CMS, you can flexibly expand the contact information of the website according to your unique business needs, providing users with a more comprehensive and convenient communication channel.This not only improves the user experience, but also enhances the professionalism and adaptability of your website in information transmission.
Frequently Asked Questions (FAQ)
Q1: I have set up a custom contact field in the background, why is it not displayed on the front page?A1: This situation usually has several causes. First, please check if you have saved the settings in the background.The most common reason is that you have not updated the template files of the website to call this new custom field, or in the templatecontactlabel'snameThe attribute value does not match the parameter name you have set in the backend. Additionally, if the website has cache enabled, you may need to clear the cache to see the update.
Q2: Can the parameter name of a custom field be in Chinese?A2: The AnqiCMS allows you to use Chinese in the "parameter name", but for the universality of the code, ease of maintenance, and to avoid potential encoding issues, it is strongly recommended to use English or pinyin as the parameter name.The system will automatically convert Chinese parameter names to CamelCase in the background for template calls, but using English can better maintain consistency.
Q3: Can I store multiple contact methods in a custom field?A3: It is technically feasible. You can enter multi-line information in the "parameter value", or use specific delimiters (such as commas, semicolons) to distinguish between different contact methods.In the template, you can use the string processing features of the Go language template engine (such assplitFilter) split this information into an array and then display it in a loop.But for better readability and manageability, it is recommended to create separate custom fields for completely independent contact methods.