How to define and call the custom system parameters of Anqi CMS in the template?

Calendar 👁️ 44

In the daily operation of Anqi CMS, we often need to handle various website-level configuration information.This information may include the company's unified contact information, links related to specific business processes, or even global switches for specific features.To meet this flexible and variable demand, Anqi CMS provides the function of customizing system parameters, which allows website operators to manage and update these global settings efficiently without delving into the code.

Custom system parameters are essentially configuration items at the website level, which are unrelated to specific articles, products, or category content, but are effective for the entire website or a specific site.The advantage of this parameter lies in centralized management and quick invocation.Once defined in the background, they can be easily referenced in any template file of the website, greatly enhancing the efficiency of content updates and template maintenance.

Define Anqi CMS custom system parameters

In AnQi CMS, the definition of custom system parameters is mainly concentrated in the "Global Settings" and "Contact Information Settings" areas of the backend.

First, visit your Anq CMS backend management interface.

  1. Custom parameters in global settings.:

    • Navigate to the 'Backend Settings' under 'Global Feature Settings'.
    • In the "Custom Settings Parameters" area at the bottom of the page, you can add new parameters.
    • Each custom parameter needs to fill in three key pieces of information: 'parameter name', 'parameter value', and 'remark.'
      • Parameter NameThis is the unique identifier you use when calling this parameter in the template.Please note that the system will automatically convert the input parameter name to camel case (i.e., the first letter of each word is capitalized, and there are no spaces in between).HelpUrlUsed for template calls.
      • Parameter valueThis is the actual storage of the custom parameter and the content that will be displayed on the front end. It can be text, URL links, numbers, etc.
      • NoteThis is only used by backend administrators for parameter descriptions and identification, and will not be displayed in the front-end template.
    • Save the settings after completing the fill.
  2. Custom parameters in the contact information settings.:

    • Navigate to the "Contact Settings" under "Backend Settings".
    • Similar to the global settings, in the "Custom settings parameters" area at the bottom of the page, you can add custom parameters related to contact information.
    • Fill in the rules for "parameter nameWhatsAppThe parameter is used to store the company's WhatsApp contact information.
    • Save the settings to make the parameter effective.

In this way, you can flexibly expand the parameters provided by the system by default to meet the personalized configuration requirements.

Call the AnQi CMS custom system parameter in the template

After defining custom parameters, the next step is how to display them in the front-end template.The AnQi CMS provides dedicated tags to call these system-level parameters, the usage of which is concise and intuitive, following the Django template engine syntax rules.

  1. Call the custom parameter in the global settingsFor the custom parameters defined in the "Global Function Settings", we need to usesystemTag to call. Its basic call format is:{% system 变量名称 with name="字段名称" %}.

    • If you want to output the parameter value directly without assigning it to a variable, you can use it directly:
      
      <div>我的帮助页面链接:{% system with name="HelpUrl" %}</div>
      
    • If you want to assign a parameter value to a local variable so that it can be used multiple times in the template or for further processing, you can use:
      
      {% system helpLink with name="HelpUrl" %}
      <p>如需帮助,请访问:<a href="{{ helpLink }}">{{ helpLink }}</a></p>
      
      Remember,nameThe value must match the parameter name defined in the "Global Feature Settings" on the backend (note the case, although the backend will automatically handle camelCase naming, the template still needs to ensure accurate matching).
  2. Call the custom parameter in the contact information settings: For custom parameters defined in the "Contact Information Settings", usecontacttags to call. The basic calling format is similar tosystemLabel similar:{% contact 变量名称 with name="字段名称" %}.

    • Directly output the parameter value:
      
      <p>我们的WhatsApp联系方式是:{% contact with name="WhatsApp" %}</p>
      
    • Assign the parameter value to a local variable:
      
      {% contact whatsappNumber with name="WhatsApp" %}
      <p>加我WhatsApp:{{ whatsappNumber }}</p>
      
      Similarly,nameThe value of the attribute should match the 'parameter name' defined in the 'Contact Information Settings' on the backend.
  3. Parameter calling in multi-site environmentIn the Anqicms multi-site management supported environment, if you need to call the system parameters of other sites, you can add extra tags insystemandcontacttagsiteIdParameters to specify the site ID. For example:

    <div>其他站点的网站名称:{% system with name="SiteName" siteId="2" %}</div>
    

    This makes cross-site data calls possible.

Application scenarios and **practice

The application scenarios of customized system parameters are very extensive, for example:

  • Social media linksUnified management of social platform URLs such as Facebook, Twitter, LinkedIn, etc.
  • Customer service contact information: Besides phone and email, it can also be a Skype ID, online customer service link, etc.
  • Global notification information: For example, website maintenance announcements, festival greetings.
  • API key or third-party service link: Used as common parameters for some integration services.
  • Business-specific configurationFor example, a product display website may need a "product consultation hotline" parameter.

The practices of using custom parameters include:

  • Keep the naming clear.Parameter names should be descriptive, allowing one to understand their purpose at a glance.
  • Differentiate the scopePlace global website settings in "Global Settings" and those strongly related to contact information in "Contact Settings".
  • Avoid overuseFor properties unique to content models (articles, products), you should manage them through custom fields of the content model, rather than abuse system parameters.The system parameters are more suitable for those that span the entire website's general configuration.
  • Update notes in a timely manner: Add detailed remarks for each custom parameter to facilitate understanding and maintenance by team members.

The Anqi CMS custom system parameter function provides a powerful and flexible tool for website operators.It not only simplifies the management of website configuration, but also brings higher freedom and efficiency to template development.By reasonably defining and calling these parameters, we can build more maintainable, responsive dynamic websites.

Frequently Asked Questions (FAQ)

1. What types of information are most suitable as custom system parameters for Anqi CMS?

Custom system parameters are most suitable for storing information that is universally applicable to the entire website or a specific site and does not change with specific content (such as articles or products).This includes but is not limited to: website name, logo image path, filing number, copyright information, social media homepage links, unified customer service phone or email, API key, external script code snippets, or any global text or link that needs to be displayed uniformly across multiple pages and is easy to modify.

2. How to ensure that the parameter name is correctly recognized when calling custom parameters in a template?

When defining custom parameters in the AnQi CMS backend, the "parameter name" you enter will be automatically converted to camel case.For example, if you enter 'Help Url', it may display as 'HelpUrl' in the background.nameThe value of the property. For example, usingname="HelpUrl"instead ofname="Help_Url"orname="helpurl"Make sure that the naming in the template matches the camel case naming generated by the background, otherwise it cannot be successfully called.

3. Can I use custom system parameters to store specific attributes of articles or products, such as the author of an article or the price of a product?

Do not do this.Custom system parameters are mainly used for general configuration at the website level.For articles, products, or other content models with unique properties, AnQi CMS provides the 'Content Model' custom field feature.You can define these fields in the corresponding 'content model' (for example, add an 'author' field to the article model, add a 'price' field to the product model), which can organize data more reasonably and support batch management and filtering of content.Mixing specific data into system parameters will make management chaotic and difficult to maintain.

Related articles

How can the role of the Anqi CMS default language package be understood, will it translate all content?

As an experienced CMS website operation personnel for an enterprise, I know that content is the lifeline of the website, and clearly understanding the system functions, especially in the aspect of multilingual management, is crucial for websites targeting different markets.Today, let's delve into the default language package of AnQi CMS and its actual role in website content translation.AnQiCMS (AnQiCMS) is a content management system for small and medium-sized enterprises and content operation teams, and its multilingual support is one of its core advantages.This allows enterprises to easily expand into international markets, allowing content to directly reach users of different languages

2025-11-06

What will the user see when the 'Website Status' of AnQi CMS is set to offline?

In the operation of Anqi CMS websites, there are sometimes situations where it is necessary to temporarily stop the website service, such as system maintenance, content updates, or emergency repairs.The AnQi CMS provides the "website status" setting, allowing operators to set the website to "shutdown" mode to manage user access in such cases.When the "Website Status" of AnQi CMS website is configured to "Offline", ordinary users will no longer be able to browse the regular content of the website when they visit.This means that all articles, products, category pages, and other dynamic content will be temporarily hidden

2025-11-06

How can you set a separate independent domain for the backend in AnQi CMS to enhance security?

As an experienced website operator who deeply understands the operation of AnQiCMS, I am well aware of the importance of content security and system stability for the website.To set up a separate domain for the background is one of the effective measures to enhance the security of CMS and ensure that website content management is not disturbed.This can not only hide the back-end entry and increase the difficulty of attackers' identification, but also provide more flexible and stricter security protection strategies for back-end management.

2025-11-06

What impact does it have if the Aqin CMS website name and website address settings are incorrect?

As a website operator who deeply understands the operation of AnQiCMS (AnQiCMS), I know the importance of basic configuration for the healthy operation of the website.In AnQi CMS, the 'website name' and 'website address' are not just simple information entries; they are the 'facade' and 'skeleton' of the website. If set incorrectly, they may bring a series of chain reactions to the website, affecting user experience, search engine optimization (SEO), and even the normal operation of the website.### The potential impact of improper website name setting Website name

2025-11-06

Does Anqi CMS support automatic downloading of remote images to local, when do I need to enable this feature?

As a website operator who deeply understands the operation of AnQi CMS and has a profound understanding of content management, I am very happy to analyze the functions and importance of AnQi CMS in remote image processing for you in depth.Images are an important part of a website's content, and their loading methods and storage locations have a direct impact on user experience and search engine optimization (SEO).The AnQi CMS indeed supports the automatic download of remote images in article content to the local server.This feature is built into the system's 'Content Settings' module, providing flexible image management options for website operators

2025-11-06

How to configure AnQi CMS to automatically filter external links in articles and add nofollow attributes?

As a senior security CMS website operations personnel, I know the importance of content quality and website health for user attraction and search engine optimization.Among them, the management of external links is a key link in maintaining the authority of the website and avoiding the loss of page weight.Aqie CMS provides a very convenient and efficient solution for this, let's learn in detail how to configure the external link handling strategy in the article.

2025-11-06

After enabling WebP image format in AnQi CMS, will the uploaded images be converted? How to convert in bulk?

As an experienced security CMS website operator, I know the importance of website performance and user experience for content operation, and image optimization is an indispensable part of it.WebP as a modern image format, with its excellent compression rate and balance of visual quality, is gradually becoming the new standard for website optimization.AnQi CMS fully considers this point, providing users with convenient WebP image support. ### In Anqi CMS, enable WebP image format Enabling WebP format in Anqi CMS is very intuitive. You just need to log in to the backend

2025-11-06

How many thumbnail processing methods does Anqi CMS have, and which one is most suitable for my website content?

As an expert in content operation for Anqi CMS, I am well aware that images, especially thumbnails, play a crucial role in attracting users, optimizing layout, and improving page loading speed.In the daily operation of Anqi CMS, we have a variety of flexible thumbnail processing methods to meet the display needs of different website content.Understanding the characteristics of these processing methods and choosing them according to the type of content on your website will be the key to improving user experience and the professionalism of your website.

2025-11-06