Does the Json-LD custom tag support dynamic retrieval of the website name and Logo from the `system` tag?

Calendar 👁️ 75

As an experienced website operation expert, I am well aware of the importance of search engine optimization (SEO) in the current situation, and structured data, especially Json-LD, is undoubtedly the key to improving the understandability and search ranking visibility of website content. Today, let's delve into a common problem encountered by AnQiCMS users:Does the Json-LD custom tag support dynamic retrieval?systemWhat are the website name and Logo in the tag?

Overview of Json-LD support in AnQi CMS

First, let's briefly review the role of Json-LD in AnQi CMS.Json-LD is a lightweight data format that allows webmasters to describe page content in a standardized way to search engines, such as whether the website is an "Organization", an "Article", or a "Product", and so on.This is crucial for search engines to understand the context of a page and generate rich media search results (Rich Snippets).

AnQi CMS as a SEO-friendly content management system naturally integrates support for Json-LD. Through its provided{% jsonLd %}...{% endjsonLd %}Custom tag, users can flexibly insert or modify structured data in the template.This flexibility is the foundation for exploring dynamic information acquisition.The design philosophy of AnQi CMS is to allow content operators to have more freedom in controlling the front-end display, which means it usually provides mechanisms to link data between different tags.

systemTag: The dynamic source of the core information of the website

In the AnQi CMS template system,systemTags play a core role, allowing us to conveniently access the global configuration information of a website. This information is usually configured in the "Global Function Settings" backend, including but not limited to the website name (SiteName)、website logo (SiteLogo)、Website Home Address(BaseUrl) and so on.

For example, in our template, we can easily obtain the website name and Logo in the following way:

{# 获取网站名称 #}
<span>网站名称:{% system with name="SiteName" %}</span>

{# 获取网站Logo并显示 #}
<img src="{% system with name="SiteLogo" %}" alt="{% system with name="SiteName" %}" />

The strength of these tags lies in their ability to dynamically extract the latest configuration from the background database, without manually modifying the template code, which greatly improves the efficiency of website maintenance.Whether we can bring this dynamism into the structured data of Json-LD?

Dynamic fusion: Json-LD custom tags withsysteminformation联动

The good news is that the design philosophy of Anqi CMS fully considers this flexibility, and the answer is definitely yes!Json-LD custom tags fully support dynamic retrievalsystemThe website name and logo in the tag.

The principle of implementation lies in the template rendering process of Anqi CMS. When the system encounters{% jsonLd %}When a label is encountered, it will not immediately treat its content as a pure JSON string, but will first parse and replace the variables and tags contained in it. This means that we can{% jsonLd %}Use the default template variable output syntax inside the block{{ 变量名 }}To embed bysystemTags or other ways to obtain dynamic data.

In order to better organize the code and avoid embedding complex tag calls directly in the Json-LD structure, we usually adopt a clearer practice method: first,systemThe value obtained from the tag is assigned to a temporary variable (using{% set %}or{% with %}Label), then embed these temporary variables into the Json-LD structure. This not only makes the code more readable and maintainable, but also conforms to good practices in front-end development.

Demonstration of practice: Building dynamic Schema.org structured data for organizations

Now, let's demonstrate how to achieve this dynamic integration through a specific example in AnQi CMS.Assuming we want to add a Schema.org "Organization" type structured data to the homepage of the website, which includes the dynamic name and Logo of the website.

{# 首先,我们利用 system 标签获取动态的网站名称和Logo,并赋值给临时变量 #}
{% set siteName = system("SiteName") %}
{% set siteLogo = system("SiteLogo") %}
{% set baseUrl = system("BaseUrl") %}

{% jsonLd %}
<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "Organization",
  "name": "{{ siteName }}", {# 这里动态嵌入网站名称 #}
  "url": "{{ baseUrl }}",
  "logo": "{{ siteLogo }}", {# 这里动态嵌入网站Logo地址 #}
  "sameAs": [
    {# 您可以在这里添加社交媒体链接等,同样可以动态获取或硬编码 #}
    "https://www.facebook.com/yourpage",
    "https://twitter.com/yourhandle"
  ],
  "contactPoint": {
    "@type": "ContactPoint",
    "telephone": "{% contact with name='Cellphone' %}", {# 动态获取联系电话 #}
    "contactType": "customer service"
  }
}
</script>
{% endjsonLd %}

In the code above, we clearly demonstrated how to{% set %}tosystemTags retrieved from comments.SiteName/SiteLogoas well asBaseUrlstore as template variables. Subsequently,{% jsonLd %}Within the block, we use it just like a regular template variable, through{{ siteName }}and{{ siteLogo }}Embed dynamic information into the JSON structure of Json-LD.Even, we also demonstrated how to dynamically obtain contact information, further demonstrating the template联动 ability of Anqi CMS.

This method not only ensures the accuracy and timeliness of structured data, but also greatly reduces the burden on content operation personnel when manually updating Json-LD code due to changes in website information.No matter how the website name or logo changes, as long as it is updated in the background "Global Function Settings", the Json-LD data on the front-end will synchronize automatically, ensuring that search engines always obtain the latest website information.

Summary

Anqi CMS dynamically acquires in Json-LD custom tagssystemThe function of the label on the website name and Logo, fully reflecting its deep consideration in content management and SEO optimization.By this flexible template mechanism, we can easily build dynamic, accurate, and easy-to-maintain structured data, laying a solid foundation for the performance of the website in search engines.


Frequently Asked Questions (FAQ)

  1. What other information can I dynamically retrieve in Json-LD, apart from the website name and Logo?Of course! You can dynamically obtain any data provided by an enterprise CMS template tag using similar logic, such as through{% archiveDetail %}Tag to get the title, author, publish date, image information of the current article, or through{% categoryDetail %}Get the relevant data of the category page. The key is to first use the corresponding tag to get the required data, and then assign it to the template variable, and then{% jsonLd %}reference these variables within the block.

  2. {% jsonLd %}Where should the tag be placed in the template?Technically, you can use it at any position in the template{% jsonLd %}Tags, but for **SEO practices, structured data in Json-LD is usually recommended to be placed on the page.<head>tag within, or follow<body>After the tags. Anqi CMS template.

Related articles

How to integrate the page's SEO title, keywords, and description into Json-LD using the `tdk` tag of AnQiCMS?

In today's highly competitive internet environment, Search Engine Optimization (SEO) is no longer an optional choice, but the foundation of website success.For systems like AnQiCMS, which are specifically designed for enterprise-level content management and SEO optimization, the various tools provided are aimed at helping operators stand out in search results.

2025-11-06

How to add multiple image URLs in Json-LD, such as the thumbnail list of an article?

As an experienced website operation expert, I am more than happy to give you a detailed explanation of how to cleverly integrate the URLs of multiple thumbnails of articles into Json-LD data in AnQiCMS, thereby enhancing the website's search engine performance and user experience. --- ## How to skillfully use AnQiCMS: Efficiently integrate multiple image URLs in Json-LD to enhance the visual appeal and search engine performance of articles In today's increasingly fierce content marketing environment, how to make search engines better understand and display your content is crucial.

2025-11-06

How to dynamically fill the `author` and `datePublished` fields in the Json-LD of AnQiCMS article page?

As an experienced website operation expert, I fully understand that in the current context where content marketing and search engine optimization (SEO) are increasingly important, it is crucial to effectively convey the core information of the page content to search engines.AnQiCMS (AnQiCMS) is an enterprise-level content management system developed based on the Go language, which provides us with great convenience with its efficient and customizable features.

2025-11-06

If a custom Json-LD field conflicts with the default field generated by AnQiCMS, which one will be displayed first?

In today's highly competitive online environment, structured data (JSON-LD) has become a key factor for website content to stand out in search engines.It can help search engines better understand the content of the page, thus giving it the opportunity to have richer display effects in the search results, which is what we commonly call 'rich media abstracts'.For a content management system like AnQiCMS (AnQiCMS) that focuses on SEO optimization, the built-in JSON-LD generation function undoubtedly provides great convenience to users.

2025-11-06

How to create a `Product` type Json-LD structured data for AnQiCMS product detail page?

AnQiCMS (AnQiCMS) is an efficient enterprise-level content management system that not only provides powerful content publishing and management functions, but also has done a lot of work in SEO optimization.For e-commerce websites or businesses with product display needs, how to make search engines better understand and display your products, and achieve higher click-through rates and conversion rates, is the key to operating success.In this, Json-LD structured data, especially the `Product` type, plays an indispensable role.

2025-11-06

How to dynamically reference the `contact` tag in Json-LD (such as phone, address)?

In today's highly competitive online environment, every detail of a website can affect its performance in search engines.As an experienced website operations expert, I am well aware of the key role that structured data plays in enhancing website visibility, and Json-LD, as a format recommended by search engines like Google, is of utmost importance.In particular for corporate websites, how to accurately and dynamically display a company's contact information to search engines, such as phone numbers and addresses, can not only enhance local search visibility but also greatly increase user trust.

2025-11-06

How to verify the validity of the Json-LD structured data generated or customized by AnQiCMS?

In today's highly competitive online environment, it is particularly important to ensure that search engines better understand your website content, so that it stands out in search results.And JSON-LD structured data is the key tool for achieving this goal.AnQiCMS is an efficient and customizable enterprise-level content management system, naturally also understands this, and provides the function of generating and customizing Json-LD structured data.But generating is not enough, how to ensure that these data are correctly parsed and effectively utilized by search engines has become a problem that website operators must pay attention to.

2025-11-06

What is the specific impact of Json-LD structured data on the search engine ranking of AnQiCMS website?

In today's highly competitive digital environment, the search engine ranking of a website directly determines its visibility and the ability to reach potential customers.For AnQiCMS and similar content management systems aimed at providing efficient solutions for small and medium-sized enterprises and content operation teams, how to better optimize SEO performance is their core value.Among them, the Json-LD structured data plays a vital role.How exactly does Json-LD affect the search engine ranking of AnQiCMS website?

2025-11-06