In website content operation, we often encounter scenarios where it is necessary to display the relevance between different contents, such as 'From A to B' in travel products, 'Comparison between Product A and Product B' on product detail pages, or 'Basic service paired with value-added services' in service plans. Anqi CMS provides two very practicalarchiveList标签参数——EnglishcombineIdandcombineFromId,它们能帮助我们以灵活且动态的方式,组合显示文档的标题和链接,从而提升内容的丰富性和用户体验。English

Deep Understanding of Composite Documents

Firstly, we need to clarify the concept of 'composite document'.In the Anqi CMS, a composite document does not refer to merging two independent documents into one, but rather to associating them at the content display level in a specific way to form a logical 'composite entity'.This combination on your website front end can dynamically reflect the presentation of titles and the link addresses after clicking, providing users with more precise and contextually relevant information.

combineIdParameters: Attach document information to list items

combineIdThe role of parameters is to, when youarchiveListThe label retrieves a document list, and for each main document item in the list, a specific "combination document" information is attached.Imagine that your main document list is of various travel destinations, and you wish to provide a travel plan starting from 'Beijing' for each destination.combineIdthe value.

For example, if we have a master document list containing multiple travel routes and we want to add "Departure City" for all these routes - assuming the document ID for Beijing is2In the template, we can use it like this:

{% archiveList archives with type="list" categoryId="1" combineId="2" limit="10" %}
    {% for item in archives %}
        <a href="{{ item.Link }}">{{ item.Title }} 到 {{ combine.Title }} 的旅游线路</a>
        {# 这里的 {{ item.Title }} 是主文档的标题,{{ combine.Title }} 则是combineId指定的文档(北京)的标题 #}
    {% endfor %}
{% endarchiveList %}

In this code,itemrepresents youarchiveListeach main document queried (for example, “Shanghai”, “Guangzhou”), andcombinethe variable represents bycombineId="2"Parameter-specified combination document ("Beijing"). Through{{ item.Title }} 到 {{ combine.Title }} 的旅游线路Such combinations enable the system to dynamically generate titles such as 'Travel route from Shanghai to Beijing', 'Travel route from Guangzhou to Beijing', and so on.

combineFromIdParameters: Front-end combination document information

WithcombineIdis similar,combineFromIdThe parameter is also used to combine documents, but it is more focused on logically displaying the specified document as a 'starting' or 'prefix' piece of information.If your need is to start from 'Beijing' and go to different tourist destinations, then 'Beijing' should be considered as a preliminary document.

沿用上面的例子,if the document ID of 'Beijing' is still2, and you want the title to display as 'Travel Route from Beijing to Shanghai', you can adjust it as follows:

{% archiveList archives with type="list" categoryId="1" combineFromId="2" limit="10" %}
    {% for item in archives %}
        <a href="{{ item.Link }}">{{ combine.Title }} 到 {{ item.Title }} 的旅游线路</a>
        {# 这里的 {{ combine.Title }} 同样是combineFromId指定的文档(北京)的标题,而 {{ item.Title }} 仍是主文档的标题 #}
    {% endfor %}
{% endarchiveList %}

The main difference lies in the order of title combination,combineFromIdLet{{ combine.Title }}come{{ item.Title }}before, and

Dynamically generate titles and exclusive links

The subtle points of these two parameters are not only that they allow you to flexibly construct composite titles, but more importantly, the Aqi CMS will also automatically generate unique pseudo-static links for these composite documents.When users click on these dynamically generated titles, they will not be directed to a single page of the main document or composite document, but will access a URL specifically designed for this combination relationship.

For example, if the document ID of 'Shanghai' is1,“Beijing”'s document ID is2then usecombineId="2"orcombineFromId="2"After that, the generated link may look like:

  • /module/1/c-2.html(indicating the main document ID is 1, and the combined document ID is 2)
  • /tour/1/c-2.html(If the module istour)

This link structure clearly indicates the relationship between two documents and is also more friendly to search engines because it creates independent entries for specific combinations of content. You can even combine multiple document IDs in a single composite URL (for example:/cpu/11/c-12-13-14.htmlThis enables the possibility of creating multi-document comparisons or complex packages. You can also use this on the relevant document detail page (i.e."),/module/main_doc_id/c-combined_doc_id.htmlsuch pages), and you can also use{{ combineArchive.文档字段 }}to call the details of the combined documents.

Examples of practical application scenarios

  1. Travel route planning:
    • Master document: Introduction to cities and attractions of various places (Shanghai, Guangzhou, Shenzhen)
    • Combined document: Departure locations (Beijing, Chengdu)
    • PasscombineFromIdorcombineId,dynamically generate "From Beijing to Shanghai travel route
  2. Product comparison analysis:
    • Main document: Detailed parameters of Product A, Product B, and Product C
    • Combined document: Another product X for comparison
    • Display “Comparison of Product A and Product X”, “Comparison of Product B and Product X”, etc., allowing users to quickly understand the differences.
  3. Educational course combination:
    • Main Document: Various Basic Courses (Math, Chinese)
    • Combined Document: Special Tutoring Courses (Olympiad Math, Writing)
    • Generate "Mathematics Basic Course with Mathematical Olympiad tutoring

PasscombineIdandcombineFromIdThese two parameters greatly expand the imagination space of content operation in Anqi CMS, allowing you to build deep connections between contents more flexibly, and provide users with more personalized and scenario-based content experience.


Common Questions (FAQ)

1. Is the link format of the combined document fixed? Can I customize it?

The link format of the combined document is usually/模块别名/主文档ID/c-组合文档ID.html. It is模块别名and主文档IDgenerated based on your document and URL rewrite rules.c-组合文档IDPart iscombineIdorcombineFromIdFeatures brought by parameters. Althoughc-The prefix is built-in, but you can adjust the website's pseudo-static rules to affect the entire URL structure, such as modifying the module alias or ID display method.

2.combineIdandcombineFromId这两个参数能同时在一个archiveList标签中使用吗?

combineIdandcombineFromId参数不能在同一个archiveList标签中同时使用。它们的作用都是指定一个额外的文档与