How to call and display the independent domain of the website backend configured in the template?

Calendar 👁️ 75

In the flexible content management system of AnQiCMS, site operators often need to display some key information of background configuration in the website template according to business needs.Among other things, the setting of 'Independent Backend Domain' concerns the security of the system. In certain specific scenarios, it may also be necessary to display it on the front end of the website, such as a quick access entry for internal personnel, or for information description on a specific page.

Today, let's delve into how to cleverly call and display the independent domain configured in the AnQiCMS template.

Understand the importance of the independent domain in the background.

AnQiCMS provides the function of setting an independent domain name for the background, which is crucial for enhancing system security.Separating the background login address from the website's front-end address can effectively reduce the risk of being maliciously scanned and attacked.

You can find and configure in the AnQiCMS backend“Background Settings” -> “Global Feature Settings”page'Backend Domain Address'This item. Make sure that the domain has been correctly resolved to your server and bound successfully on the server, otherwise you will not be able to access the backend normally.

Call the background independent domain in the template

The AnQiCMS template system is very powerful and easy to use, it adopts a syntax similar to the Django template engine. To obtain various global information of the background settings, we mainly rely onsystem.

systemTags are used to call system global configurations. Their basic usage is{% system 变量名称 with name="字段名称" %}.nameParameters are used to specify the configuration items you want to retrieve.

Although the AnQiCMS documentation does not explicitly list the parameter name for the background domain address,namebut according to other system settings (such asSiteName/BaseUrlThe naming convention, we can reasonably infer its internal call name asAdminUrl.

Now, let's see how to apply it in the template:

1. Directly output the independent domain of the background:

If you just want to simply display the background domain at a certain position on the page, you can do it directly insystemUsed in tagsname="AdminUrl":

<p>您好,内部管理系统入口: <strong>{% system with name="AdminUrl" %}</strong></p>

2. Assign the independent background domain to a variable and use it:

If you need to process the backend domain you have obtained, or use it multiple times in a template, you can first assign it to a variable, making the code clearer:

{% system adminBackendDomain with name="AdminUrl" %}

{% if adminBackendDomain %}
    <p>管理员请点击此处登录:<a href="{{ adminBackendDomain }}" target="_blank" rel="nofollow">{{ adminBackendDomain }}</a></p>
    <p>如果您遇到问题,请联系技术支持。</p>
{% else %}
    <p>后台管理域名未配置,请联系系统管理员。</p>
{% endif %}

In the above example, we first use{% system adminBackendDomain with name="AdminUrl" %}The background independent domain name was assigned toadminBackendDomainthis variable. Then, we go through{% if adminBackendDomain %}Determine if the domain exists (i.e., whether it has been configured in the background), and then display it. This is a good programming habit that can avoid page display errors due to missing configuration.

Example of practical application scenarios

  • Internal Management Page Prompt:On the page specially prepared for internal staff, the back-end login entry can be clearly displayed for easy access by staff.
  • Corporate Intranet Portal:In the internal website portal used, AnQiCMS backend can be used as a shortcut entry for one of the internal systems.
  • Development debugging information:During the development or testing phase, it may be convenient to temporarily display the backend domain name in the footer, but it must be removed after going live.
  • Security Information Disclosure (Special Cases):In rare cases, it may be necessary to disclose the separation status of the background domain and the front-end domain to comply with certain security audits or internal regulations.

Points to note

  • Consideration of security:Unless there is a clear internal need, it is generally not recommended to directly display the independent backend domain on a public-facing front-end page. This may increase the risk of the backend being detected.
  • Domain configuration first:Call in the templateAdminUrlBefore, make sure you have correctly configured the 'Global Function Settings' in the AnQiCMS backend and that the domain name has completed DNS resolution and server binding. If not configured,AdminUrlMay return an empty value or the home page address plus/system/the suffix depends on the internal logic of AnQiCMS.
  • Cache cleanup:After modifying the template file, sometimes you need to manually clean the system cache of AnQiCMS (更新缓存feature) or the browser cache to ensure that the new template content takes effect in a timely manner.

By using the above method, you can flexibly call and display the independent domain name in the AnQiCMS template to meet your specific operational needs.The strength of AnQiCMS lies in its high customizability, allowing you to easily control the display and management of content.


Frequently Asked Questions (FAQ)

1. If I have not set up an independent domain for the background,AdminUrlwhat will the tag display?

If you have not configured the "Background Domain Address" in the "Global Function Settings" of the AnQiCMS background, then{% system with name="AdminUrl" %}Tags usually return the root domain of your website plus the default admin path, for examplehttp://yourdomain.com/system/. However, to avoid uncertainty, it is strongly recommended that you always explicitly set a separate admin domain and according to{% if adminBackendDomain %}The way to judge and display.

2. Can I directly modify or submit the backend domain in the template?

No. In the template,systemThe tag is only used forreadingThe parameter is configured on the back-end, it is a read-only operation. You cannot modify any back-end configuration items through template code, including the back-end independent domain name.All changes to backend settings must be made through the AnQiCMS administrative backend interface to ensure data security and system stability.

3. BesidesAdminUrlWhat are some commonly used system information that can be accessed throughsystemtag calling?

systemTags can call many useful global information, such as:

  • SiteName(Website Name)
  • SiteLogo(Website Logo Image Address)
  • BaseUrl(Homepage Address)
  • MobileUrl(Mobile Website Address, if a separate mobile domain is configured)
  • SiteIcp(Website Record Number)
  • SiteCopyright(Website Copyright Information)
  • TemplateUrl(Current template static files (CSS/JS

Related articles

How to display the AnQiCMS built-in system language package switch feature on the front page?

AnQi CMS provides a flexible mechanism to allow your website to better serve users in different languages around the world.When you want to implement language switching on the front page, the tags and backend configuration built into AnQiCMS can well meet this need.Understanding AnQiCMS language package mechanism First, we need to clarify the concept of "language package" in AnQiCMS.The system language package built into AnQiCMS is mainly responsible for switching the website backend interface and the language of the**system built-in prompts, labels, etc.**on the front-end page.

2025-11-07

How to display the unique content and images of a custom page (single page)?

In website operation, we often need to create some unique content and personalized page layouts, such as 'About Us', 'Contact Information', or a specific event detail page.AnQiCMS (AnQiCMS) has provided us with a powerful custom page (single page) feature, which not only allows us to easily manage the text content of these pages, but also flexibly display their exclusive images and customized layouts.How to specifically operate, so that the custom page has its own unique content and image display method?

2025-11-07

How to batch modify keywords in the article content in the background and synchronize them to the front display?

In website content operation, the accuracy and timeliness of keywords are crucial.With market changes or SEO strategy adjustments, we often need to make batch modifications to the keywords of a large number of articles on the website.If done manually, it will undoubtedly consume a lot of time and effort.幸运的是,AnQiCMS(AnQiCMS)提供了高效的批量关键词替换功能,让这一process变得得心应手,并能确保修改后的内容无缝同步到前台显示。

2025-11-07

How to use the `tagList` tag to display the associated tag (Tag) cloud of the article?

AnqiCMS provides a series of powerful and flexible tags to help us manage and display website content more efficiently.Among many features, the article tag (Tag) is a very practical feature that can effectively organize content, enhance the internal link structure of the website, and make it convenient for visitors to quickly find related topics of interest.Today, let's delve into how to use the `tagList` tag to elegantly display related tags in the AnqiCMS template, and even build a dynamic 'tag cloud'.

2025-11-07

How to ensure that the website displays a custom prompt to users when it is in "shutdown" status?

In website operation, we sometimes encounter situations where we need to temporarily close the website, such as for system maintenance, major upgrades, data migration, or dealing with unexpected security events.For any reason, directly allowing users to access a blank page or an error page will severely affect user experience and even damage the brand image.At this time, it is particularly important to clearly display a friendly prompt message to visitors.

2025-11-07

How to display the number of comments for each article on the article list page?

In website operation, the article list page is not only the entrance of content, but also a window for users to understand the activity level of the website.When users see that every article is accompanied by a comment count, this not only effectively enhances the interactivity and attractiveness of the article, but also brings positive social proof to the website, encouraging more readers to participate in discussions.For users who use AnQiCMS, displaying the number of comments for each article on the article list page is a very direct and practical feature.

2025-11-07

How to use the `pagination` tag to build standard pagination navigation in the template?

When the content of a website becomes richer, a clear and efficient pagination navigation system is crucial for improving user experience.The AnQiCMS template system provides a powerful `pagination` tag that allows us to easily build standard, beautiful pagination navigation.Next, we will delve deeper into how to use this tag in templates.

2025-11-07

How to display the custom parameter list in the article content on the front page?

AnQiCMS as an efficient and customizable content management system provides powerful content model features, allowing us to add various custom fields to articles according to different business needs.These custom parameters not only make the article content more rich and structured, but also allow for personalized display on the front page, greatly enhancing the flexibility and user experience of the website.Today, let's delve into how to flexibly display these custom parameter lists in the AnQiCMS front page.

2025-11-07