Contact Information Settings for AnQi CMS: Easily add custom fields to meet your unique needs
In the operation of a website, an efficient and personalized way of displaying contact information is often a key factor in establishing trust between the company and the user, and in promoting conversions.SafeCMS knows this well, its powerful customization allows you to easily exceed the default settings, adding exclusive contact fields to your website, ensuring that your site can perfectly match the unique needs of your business.
AnQi CMS as an efficient and customizable enterprise-level content management system not only provides rich content models and SEO tools, but also showcases its flexibility in detail.For basic yet important information such as contact details, the system allows for deep customization.
Why do you need custom contact fields?
In actual operation, the standard contact phone number, email, and address may not cover all of your communication channels.Perhaps your business needs to showcase specific instant messaging tools, such as Telegram, Line ID; or you may need to list international fax numbers, online customer service links; or, to better serve global users, you may want to add multilingual customer service contact information, even social media accounts (such as WhatsApp, Facebook Messenger ID) so that users can easily reach out.The custom contact field feature 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 complete it easily.
Please log in to the Anqi CMS backend management 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 settings.
On the 'Contact Information Settings' page, you will see a series of commonly used contact information fields provided by Anqi CMS by default, such as contact person, phone number, contact address, email address, WeChat ID, and WeChat QR code, etc.These fields cover most of the basic needs of websites.
However, our goal is to add a new custom field. Please note a field named “Customize settings parametersThe area of the quote. This is where we exert our custom magic.
Add custom parameters:In the "Custom Settings Parameters" area, you will find the entry to add a new field.There will usually be a “Add” button or a direct option to add a new row in the table.Parameter name/parameter valueand[en] Note.
Define parameter name (Template Call Name):This is the unique identifier you use when calling this custom field in the website template.To maintain the cleanliness and maintainability of the code, it is strongly recommended that you use English words or pinyin as parameter names.
skype_idIt will be called in the template asSkypeId. 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 this custom contact method. For example, if your parameter name is
SkypeIdThen enter your Skype account as the parameter value; if it isInternationalFaxEnter the international fax number. The information entered here is what users see on the front page.Fill in the remark (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 convenience for future maintenance.For example, you can fill in 'Enterprise Skype Online Communication Account' or '24-hour International Fax Hotline'.
Save changes:After filling in, please make sure to click theSavebutton at the bottom of the page to ensure that your changes take effect.
Integrate custom fields into the website template
It's not enough to just add custom fields in the background; to display this information on your website, you also need to integrate it into the website's template files. Anqi CMS provides a simple yet powerfulcontactLabel to retrieve this contact information.
You only need to use it in the template (usually in the footer, contact us page, or sidebar, etc.){% contact %}tags, and throughnameSpecify the 'parameter name' you just created.
For example, if you create a nameSkypeId[en]The custom contact field, and you want to display it on the website, you can call it like this in the template file:
{# 获取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 with links), remember to add it when calling the template.|safeFilter to ensure that the content is parsed correctly rather than being escaped. For example:<div>{% contact with name="CustomHtmlInfo" %}|safe %}</div>.
Operation Tips
- Keep parameter names concise and clearThis not only makes it easier to remember, but also makes template calls more intuitive.
- Thorough testingEnsure that the new contact field is displayed correctly on the front page after modifying the template, and make sure its format and functionality meet expectations.
- Consider responsive design.If your website supports mobile, please ensure that the newly added contact information displays and operates well on all devices, for example, the phone number can be clicked to dial, and the instant messaging ID can be one-click navigated.
Through the custom field function in the contact information settings of Anqi CMS, you can flexibly expand the contact information of the website according to the unique needs of your business, providing users with a more comprehensive and convenient communication channel.This not only enhances the user experience, but also strengthens the professionalism and adaptability of your website in information transmission.
Common Questions (FAQ)
Q1: I have set up a custom contact field in the backend, why is it not displayed on the front page?An A1: This situation usually occurs for several reasons.Firstly, please check if you have saved the settings in the background.contactTagsnameThe value does not match the "parameter name" set in the background. Additionally, if the website has caching enabled, it may be necessary to clear the cache before seeing the updates.
Q2: Can the parameter name of a custom field be in Chinese?A2: The SecureCMS allows you to use Chinese in '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 camel case (CamelCase) in the background for template calls, but using English can better maintain consistency.
Q3: Can I store multiple contact methods in one custom field?A3: It is technically possible.You can enter multi-line information in the "Parameter Value" field, or use specific delimiters (such as commas, semicolons) to distinguish between different contact methods.splitFilter) Split this information into an array and then display it in a loop.But for better readability and manageability, it is more recommended to create separate custom fields for completely independent contact methods.