In today's highly competitive digital environment, owning multiple websites to cover different brands, product lines, or regional markets has become the norm.AnQiCMS (English: AnQi CMS) boasts its powerful multi-site management capabilities, providing great convenience for enterprises and content operators.However, when it comes to the core issue of Search Engine Optimization (SEO) - structured data (Json-LD), how to cleverly integrate site-specific information into Json-LD in a multi-site mode, ensuring that each site can accurately convey its unique value to search engines, has become an important issue facing us.

Today, let's delve into how Json-LD custom tags effectively differentiate data between different sites under the AnQiCMS multi-site management mode, helping each of your sites stand out in search engines.

Understanding the multi-site management mechanism of AnQiCMS

The multi-site management feature of AnQiCMS is one of its core advantages.It allows you to easily create, deploy, and manage multiple independent websites within the same background system.Independent configuration information.

This architecture design greatly improves operational efficiency and avoids the繁琐 of deploying and maintaining multiple systems.However, this combination of sharing and independence also requires that we strategically differentiate and call data during refined content operations, especially for SEO work that requires high customization like Json-LD.

Application and challenges of Json-LD in AnQiCMS

Json-LD is a lightweight JSON-based structured data format widely used to provide clear information about page content to search engines, such as the author of the article, publication date, product price, inventory, and even contact information of the enterprise organization.This is crucial for improving the display effect of the website in search results (such as rich media summaries) and understanding.

In AnQiCMS, you can customize tags{% jsonLd %}...{% endjsonLd %}Come up with flexibility to insert and control Json-LD data on the page.The power of this tag lies in the fact that it not only allows you to embed any code that conforms to the JSON-LD syntax, but also can merge or override the default structured data generated by AnQiCMS.When your custom field conflicts with the default field, your custom settings will take precedence.

However, careful operators may notice,jsonLdthe tags themselves do not provide directsiteIdParameters are used to differentiate data from different sites.This means that we cannot simply declare 'This is Site A's data' or 'This is Site B's data' directly in the Json-LD code.How should we solve this problem?

核心策略:巧妙利用AnQiCMS的站点特定数据标签

To resolve the issue of data differentiation under the multi-site mode of Json-LD, the key is to make full use of the characteristics of the AnQiCMS template engine:When rendering any page, AnQiCMS is clear about which site the current page belongs to.This allows us to dynamically obtain the data of the current site through other built-in, site-distinguishing tags and seamlessly inject it intojsonLdthe tag block.

AnQiCMS provides many powerful data tags, such as:

  • systemTags:Used to obtain the global configuration information of the current site, such as:SiteName[Website Name],BaseUrl(Homepage address of the website),SiteLogo(Website Logo), etc.
  • contactTags:Used to obtain the contact information of the current site, such asCellphone(Contact phone number),Email(Contact Email),Address(Contact address) and so on.
  • tdkTags:Used to obtain the SEO meta information of the current page, such asTitle(Page Title)、Keywords(Page keywords),Description(Page description) and so on.
  • archiveDetail/categoryDetail/pageDetailTags:Used to get the detailed content of the current article, category, or single page, including title, description, image, publication time, etc.

These tags will automatically look up data from the current site's corresponding database and configuration when called. This means that as long as your template correctly uses these tags to retrieve information and place it injsonLdTag block internal, then the output Json-LD data is naturally the exclusive data of the current site.

Practical Case: Building Dynamic Json-LD

Let's look at a specific example to see how to operate.We want to generate a Json-LD structured data for each site that is targeted at the "Organization" type and the "Article" type.

auto

{# Generate Json-LD dynamically based on page type #}