In website content operation, we often encounter scenarios where it is necessary to show the correlation between different contents, such as the "From A to B" in travel products, the "Comparison of Product A and Product B" on the product details page, or the "Basic service combined with value-added service" in the service plan. Anqi CMS provides two very practicalarchiveListLabel parameters——combineIdandcombineFromIdThey can help us combine the title and link of the document in a flexible and dynamic way, thus enhancing the richness of the content and the user experience.

Understand the Composed Document Deeply

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

combineIdParameters: Attach document information to list items

combineIdThe role of the parameter is to pass through youarchiveListTagging the document list, an additional 'composite document' information is attached to each main document item.Imagine that your main document list is of various tourist destinations, and you want to provide a travel plan starting from "Beijing" for each destination.At this time, you can use the ID of the document "Beijing" ascombineIdthe value.

For example, if we have a master document list containing multiple travel routes and we want to add the 'departure city' for these routes - assuming the document ID for Beijing is2. We can use it in the template 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 block,itemrepresents youarchiveListeach main document queried out (for example, "Shanghai", "Guangzhou"), andcombinethe variable represents bycombineId="2"The parameter specified composite document (Beijing). Through{{ item.Title }} 到 {{ combine.Title }} 的旅游线路Such a combination, the system can dynamically generate titles such as 'Shanghai to Beijing travel route', 'Guangzhou to Beijing travel route', and so on.

combineFromIdParameter: Pre-combined document information

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

Follow the above example, if the document ID of “Beijing” is still2and 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 }}in front,{{ item.Title }}at the back, which is more in line with the expression habit of 'from where to where'.

Dynamic generation of titles and exclusive links

The exquisite part of these two parameters lies in the fact that they not only allow you to flexibly build composite titles, but more importantly, Anqi CMS will also automatically generate unique 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 be directed to a URL specifically designed for this composite relationship.

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

  • /module/1/c-2.html(indicating that 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 provides the possibility of creating multi-document comparisons or complex packages. On the relevant document detail pages (i.e./module/main_doc_id/c-combined_doc_id.htmlsuch pages), you can also use{{ combineArchive.文档字段 }}to call the detailed information of the combined documents.

Examples of actual application scenarios

  1. Travel route planning:
    • Master document: Introduction to city attractions in various places (Shanghai, Guangzhou, Shenzhen)
    • Combined document: Departure locations (Beijing, Chengdu)
    • BycombineFromIdorcombineIdDynamic generation of travel routes from Beijing to Shanghai, Chengdu to Guangzhou, and so on, and pointing to exclusive combination pages.
  2. Product comparison analysis:
    • Master document: Detailed parameters of Product A, Product B, Product C
    • Combined document: Another product X for comparison
    • Display comparisons such as “Product A vs. Product X” and “Product B vs. Product X” and others, allowing users to quickly understand the differences.
  3. Educational course combination:
    • Master document: Various basic courses (Mathematics, Chinese)
    • Composite document: Specialized tutoring courses (Mathematical Olympiad, Writing)
    • Generate combinations such as 'Mathematics basic course with Olymics tutoring', 'Chinese basic course with writing skills', etc., to show the diversity of packages.

BycombineIdandcombineFromIdThese two parameters greatly expand the imagination space of content operation for AnQi CMS, allowing you to build deep connections between content more flexibly, providing users with more personalized and scenario-based content experiences.


Frequently Asked Questions (FAQ)

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

The format of the combined document link is usually/模块别名/主文档ID/c-组合文档ID.html. It contains the模块别名and主文档IDIt is generated based on your document and rewrite rules, andc-组合文档IDpart iscombineIdorcombineFromIdThe feature brought by the parameter. Althoughc-The prefix is built-in to the system, but you can adjust the pseudo-static rules of the website to affect the structure of the entire URL, such as modifying the module alias or the display method of the ID.

2.combineIdandcombineFromIdCan these two parameters be used in the samearchiveListtag?

combineIdandcombineFromIdParameter cannot be used in the samearchiveListtag at the same time. Their function is to specify an additional document with