Easily display the system name configured in the AnQiCMS website

The system name of a website is a core component of its online identity, it is not just a simple name, but also a key factor in brand image, search engine optimization (SEO), and user identification.For AnQiCMS users, displaying the system name configured in the backend on the website front-end can ensure the consistency of website information, enhance user experience, and improve search engine friendliness.This article will introduce in detail how to find and flexibly use the system name in AnQiCMS, making it omnipresent in your website and just right.

Understand the "system name" in AnQiCMS

In the AnQiCMS backend, the system name usually refers to the brand name or main title of your website, which plays an important role in many places.To view or modify it, you can log in to the AnQiCMS backend, navigate to the 'Backend Settings' menu, and then click 'Global Function Settings'.Here, you will find a configuration item named "Website Name".This value is the basic name recognized and used by the AnQiCMS system across the entire site.It not only affects the display title of the website, but also is the basis of some default functions (such as the record information link).

Call the system name in the template

AnQiCMS provides powerful template tag functions, making it very simple to obtain background configuration information on the website front end. To display the system name, we mainly use a name calledsystemThe template tag. This tag is used to retrieve global system configuration information.

The usage is very intuitive: you need to specify the "field name" of the configuration item you want to obtain. For the website name, its field name isSiteName.

For example, if you want to display the website name directly in a paragraph, you can write the template code like this:

<p>欢迎访问 {{ system with name="SiteName" }}!</p>

Here{% system with name="SiteName" %}The website name will be replaced by the background configuration. For convenience in reuse in the template, you can also assign it to a variable:

{% system siteName with name="SiteName" %}
<p>欢迎访问 {{ siteName }}!</p>

Thus,siteNameThe variable stores the website name configured on the backend, which can be reused in other places of the current template.

Combine with the actual application scenario

The application of the system name is far more than simply displaying text, it plays a role in enhancing professionalism and SEO effects at multiple key locations on the website.

A. In the website title (<title>Tag application

Website<title>Tags are an important basis for search engines to judge the theme of web page content, and they are also the first impression that users see in the browser tab or search results.usually, we hope the title can include the content of the current page and use the website name as a suffix for brand recognition.AnQiCMS provided for thistdk(Universal TDK) Tag, making this operation flexible and in line with SEO**practice.

in the template's<head>Part, you can configure it like this:

<title>{% tdk with name="Title" siteName=true %}</title>

This code will automatically retrieve the main title of the current page and append it with the "Website Name" from the background "Global Function Settings". If you want to customize the title separator, for example, using_This is not the default one-, you can set it like this:

`twig{% tdk with</p> </div> </div> </div> <div class="layui-card"> <div class="layui-card-body"> <div class="article-prev-next"> <li> Previous: <a href="https://en.anqicms.com/blog/7075.html">How to display the title and link of the previous and next articles on the article detail page?</a> </li> <li> Next: <a href="https://en.anqicms.com/blog/7077.html">How to dynamically obtain and display the website's logo image address in AnQiCMS templates?"</a><a></a>\n \n \n <li></li>\n <div></div>\n <div></div>\n <div></div>\n <div></div>\n <div></div>\n <div></div>\n <div class=\</h5>\n </a>\n </li>\n \n </li>\n <a href=\</h5> </a> </li> </li class="item"> <a href="https://en.anqicms.com/blog/10496.html" class="link"> <h5 class="title">Does the AnQiCMS document list interface support more complex queries of the `extra` field in the returned data?</h5> </a> </li> </li class="item"> <a href="https://en.anqicms.com/blog/10495.html" class="link"> <h5 class="title">How to use the `archive/list` interface to dynamically load more documents on the front-end (infinite scrolling)?</h5>\n </a>\n </li>\n\n </li>\n <li class=\</h5> </a> </li> </li class="item"> <a href="https://en.anqicms.com/blog/10493.html" class="link"> <h5 class="title">What will `data` and `total` return if no documents meeting the conditions are found in the AnQiCMS document list??</h5> <a href=\</h5> </a> </li> <li class="item"> <a href="https://en.anqicms.com/blog/7074.html" class="link"> <h5 class="title">How to use AnQiCMS template tags to dynamically display content data on the front-end page?</h5>\n </a>\n </li>\n \n \n <li class=\</h5> </a> </li> <li class="item"> <a href="https://en.anqicms.com/blog/7077.html" class="link"> <h5 class="title">How to dynamically obtain and display the website logo image address in AnQiCMS template? </a> </li> </h5> </a> </li> </li class="item"> <a href="https://en.anqicms.com/blog/7078.html" class="link"> <h5 class="title">How to display the filing number and copyright information at the bottom of AnQiCMS website?</h5> </a> </li> </li class="item"> <a href="https://en.anqicms.com/blog/7079.html" class="link"> <h5 class="title">How to display the base URL address of the current website in AnQiCMS template?</h5> </a> </li> </ul> </div> </div> </div> </div> </div> <div class="footer-block"> <footer class="layui-footer"> <div class="layui-container"> <div class="layui-row layui-col-space30" style="margin-left: -8px;"> margin-right: -8px; row-gap: 16px;"> <div class="layui-col-lg4 footer-block"> <h3>Anqi Content Management System (AnqiCMS)</h3> <p><img src="/anqicms.png" style="width: 96px;" /></p> <p>AnqiCMS Content Management System, an enterprise-level content management system developed using GoLang, is easy to deploy, secure, elegant, compact, and fast in execution. Websites built with AnqiCMS can prevent many security issues.</p>\n </div>\n <div class=\ al.src = "/api/log?action=views&code=200&id=7076&path=http%3A%2F%2Fwww.anqicms.com%2Fblog%2F7076.html&type=archive&nonce="+Date.now(); document.body.appendChild(al); })(); </script> <script src="https://en.anqicms.com/static/anqitpl1/js/template.js?v=1.3"></script> <script src="https://en.anqicms.com/static/anqitpl1/layui/layui.js"></script> <script type="module"> import mermaid from 'https://cdn.jsdelivr.net/npm/mermaid@10/dist/mermaid.esm.min.mjs'; mermaid.initialize({ startOnLoad: true }); </script> <script> layui.config({ base: "https://en.anqicms.com/static/anqitpl1/js/" }).use(['index','pjax']); //Loading entry </script> <script src="https://en.anqicms.com/static/anqitpl1/js/app.js?v=1.5.7"\u003e\u003c/script\u003e\n\n\n\u003cdiv class="layui-hide"\u003e\u003cscript\u003e\nvar _hmt = _hmt || []; (function() { var hm = document.createElement("script"); hm.src = "https://hm.baidu.com/hm.js?23ac1576d1ee72920a3d65a2cf536ac0"; var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(hm, s);))(); </script> </div> </html>