How to implement the combination of document title and link display with the `combineId` and `combineFromId` parameters in the `archiveList` tag?

Calendar 👁️ 77

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

Related articles

How to retrieve and flexibly display custom parameter fields in the document model with the `archiveParams` tag?

When managing content in AnQi CMS, we often encounter situations where we need to add specific attributes for different types of content (such as articles, products).The 'Content Model' feature provided by AnQi CMS allows us to customize fields according to business requirements, greatly enhancing the flexibility and scalability of content.How can I elegantly and flexibly obtain and display these custom parameter fields in the website front-end template?The `archiveParams` tag is the key to solving this problem.### Understanding the Custom Parameters in the Document Model Diving deeper into

2025-11-08

How does the `archiveDetail` tag handle the Markdown rendering and lazy loading (lazyload) display of document content?

Manage and display content in Anqi CMS, the `archiveDetail` tag is undoubtedly one of the core tools, responsible for extracting document content stored in the database and rendering it on the web.For modern websites, the way content is presented and the loading efficiency are crucial, and `archiveDetail` provides very practical capabilities in handling Markdown rendering of document content and image lazy loading.### Cleverly Utilize `archiveDetail` Tag

2025-11-08

How to ensure that the AnQiCMS front-end page updates and displays the new image after the image resource is replaced?

When using AnQiCMS for website content maintenance, images are indispensable visual elements.However, sometimes the image resources are successfully replaced in the background, but the front page fails to display the updated image in time, which may confuse you.This is usually not a system failure, but due to the operation of various caching mechanisms.Understanding these mechanisms and mastering the corresponding handling methods can help you efficiently solve this problem.## The intrinsic mechanism of AnQiCMS image replacement Firstly, it is crucial to understand how AnQiCMS handles image replacement

2025-11-08

How to support image classification and replacement in image resource management while keeping the URL address unchanged to avoid display issues?

In today's digital world, website content not only needs high-quality text, but also engaging visual elements.Images, as an important component of website content, their effective management is directly related to user experience, SEO effect and daily operation efficiency.For us who are committed to efficient content management, how to properly organize and update image resources while avoiding potential problems is an indispensable part of our daily work.AnQiCMS is well-versed in this, and its image resource management function is meticulously designed to address these pain points.

2025-11-08

How to get the character length of the article title `archive.Title` for content truncation display?

In website content display, controlling the length of article titles is a common requirement, especially in list pages, recommended positions, and other scenarios, where overly long titles may destroy the page layout and affect user experience.AnQiCMS provides powerful and flexible template tags and filters to help users easily obtain and truncate the display of article titles `archive.Title`. ### Article Title in AnQiCMS Template In the AnQiCMS template, when we handle article data, we usually go through

2025-11-08

How to judge the length of the article summary `archive.Description` to decide whether to display the 'Read More' link?

In website operation, the neatness of the content list page and the user experience are crucial.When the article summary is too long, it may not only occupy too much page space, affecting the overall layout beauty, but may also dilute the guiding role of the 'Read More' link.Therefore, deciding intelligently whether to display a "Read More" link based on the actual length of the article summary is an effective strategy to enhance the professionalism and user-friendliness of the website.AnQiCMS (AnQiCMS) provides powerful and flexible template functions, making it simple and efficient to meet this requirement.### Understand `archive

2025-11-08

How to limit the maximum number of characters that `archive.Content` displays in the summary in the template?

In website operation, how to efficiently display content summaries that can attract visitors to click and maintain the page tidy is a common and important issue.For those who use AnQiCMS, we often need to extract the essence of the document content as a summary to be displayed on list pages, search result pages, or related article recommendation modules.This article will introduce how to precisely control the maximum number of characters displayed in the `archive.Content` field in the AnQiCMS template summary.### Understand `archive.Content`

2025-11-08

How to check how many images are included in the group image `archive.Images` array on the article detail page?

It is crucial to manage the image display on the article detail page flexibly and accurately when building website content in AnQi CMS.Especially when we need to use multiple images to enrich the content of an article, the collage feature (usually corresponding to the `archive.Images` field) provides an efficient and convenient solution.In the operation, sometimes we need to understand how many images a specific article detail page contains, whether it is for page layout design, content statistics, or executing logic judgments under specific conditions.This article will elaborate on how to accurately check in AnQi CMS templates

2025-11-08