What can be placed between `{% breadcrumb %}` and `{% endbreadcrumb %}` of AnQiCMS breadcrumb navigation tag?

Calendar 👁️ 60

As an experienced website operations expert, I know that the navigation structure of a website plays a crucial role in user experience and search engine optimization (SEO).A clear breadcrumb navigation (Breadcrumb Navigation) not only helps users understand their position on the website but also provides valuable website structure information for search engines.

AnQiCMS as a powerful and flexible content management system, provides us with{% breadcrumb %}Labels can easily build breadcrumb navigation. However, many operators may be confused when they first encounter it.{% breadcrumb %}and{% endbreadcrumb %}I am puzzled about what content can be placed between these tags. Today, I will deeply interpret the mysteries of these tags for everyone.

AnQiCMS Breadcrumb Navigation:{% breadcrumb %}with{% endbreadcrumb %}The connotation and practice

In simple terms,{% breadcrumb %}and{% endbreadcrumb %}The area between, which is the 'canvas' you use to define how breadcrumb navigation is rendered and displayed. When the AnQiCMS template engine parses to{% breadcrumb %}When a tag is used, it dynamically generates an array (or list) containing the complete navigation path information of the current page, and assigns this array to the variable specified in the tag—usually namedcrumbsTherefore, what we mainly place between these tags is the code for traversing and displaying thiscrumbsloop structure of the array content.

ThiscrumbsEach element of the variable represents a link in the navigation path, it at least contains two core attributes:Name(the displayed text of the link) andLink(The target URL of the link). To demonstrate these steps one by one, we will naturally use a template engine'sforLoop tag.

Core structure inside the tag: loops and data rendering

In{% breadcrumb crumbs %}and{% endbreadcrumb %}between, the core content iscrumbsVariable iteration. AnQiCMS will automatically generate the complete path from the homepage to the current page based on the type of the current page (such as article detail page, category list page, single page, etc.) and encapsulate the information of each path node intocrumbsthe array.

You need to do is:

  1. Declare a variable to receive the breadcrumb data:In{% breadcrumb %}In the tag, you will see:{% breadcrumb crumbs %}This kind of writing,crumbsIs the name you give to this breadcrumb data array.
  2. UseforLoop through this variable:TargetcrumbsThrough each element in the array, you need to{% for item in crumbs %}to loop.
  3. Render eachitemthe content of:Inforinside the loop,itemThe variable represents the current breadcrumb node being processed. You can accessitem.NameGet the display text of the node throughitem.LinkGet the link address of the node. Usually, we will wrap them in<li><a>Such an HTML structure conforms to the semantic standards of breadcrumb navigation.

Basic structure example:

<nav aria-label="breadcrumb">
    <ol class="breadcrumb">
        {% breadcrumb crumbs %}
            {# 在这里,我们遍历 crumbs 数组,item 代表每个面包屑节点 #}
            {% for item in crumbs %}
                <li class="breadcrumb-item">
                    {# 判断是否是最后一个元素(当前页面),最后一个通常不带链接 #}
                    {% if forloop.Last %}
                        <span class="active">{{ item.Name }}</span>
                    {% else %}
                        <a href="{{ item.Link }}">{{ item.Name }}</a>
                    {% endif %}
                </li>
            {% endfor %}
        {% endbreadcrumb %}
    </ol>
</nav>

In this example:

  • We used<nav>and<ol class="breadcrumb">Tags to provide semantic and style basis.
  • {% breadcrumb crumbs %}Tell AnQiCMS to generate breadcrumb data and assign it tocrumbs.
  • {% for item in crumbs %}Loop throughcrumbsarray.
  • forloop.LastIs the loop auxiliary variable provided by the AnQiCMS template engine, used to determine whether the current loop is the last element.This is a commonly used logic in breadcrumb navigation, that the current page usually only displays text without providing links.
  • {{ item.Link }}and{{ item.Name }}Outputted the links and names of the breadcrumb nodes respectively.

{% breadcrumb %}The parameters carried by the tag itself

Although we are concerned with the content inside the tag, but{% breadcrumb %}The parameters carried by the tag itself will directly affectcrumbsThe generation result of the array, thus indirectly affecting the display logic inside the tag pair.

  • indexparameters:Used to set the display name of “Home” in the breadcrumb navigation. The default value is “Home”.
    • Example:{% breadcrumb crumbs with index="我的博客" %}Will display the home page link as “My Blog”.
  • titleparameters:Control the display mode of the current page (the last node of the breadcrumb path).
    • title=true(Default): Display the actual title of the current page.
    • title=false: Do not display the current page title, the current page will be blank in the breadcrumb.
    • title="自定义文本": Display the custom text you specify as the current page title.
    • Example:{% breadcrumb crumbs with title="当前位置" %}Will display the current page as 'Current Location'.
  • siteIdparameters:Used under the multi-site management mode. If you need to call data from a specific site to generate breadcrumbs, you can do so bysiteId="N"Specify. Usually, this parameter does not need to be set in a single-site environment.

Custom display example (home page name and title control):

Suppose we want to change the homepage name from the default “Homepage” to “My Blog”, and display a fixed text “Details Page” on the current page, we can adjust it like this{% breadcrumb %}Label's parameters:

`twig

Related articles

How to add icons or additional text to breadcrumb navigation items in AnQiCMS template?

As an experienced website operations expert, I am well aware of the importance of breadcrumb navigation in website user experience (UX) and search engine optimization (SEO).It not only clearly tells the user where they are, helping them easily backtrack, but also provides clues about the structure of the website to search engines.However, most of the time, the default breadcrumb navigation seems too plain, lacking personality and visual guidance.

2025-11-06

What is the default display behavior and level depth of the AnQiCMS breadcrumb navigation?

As an experienced website operation expert, I am well aware of the importance of breadcrumb navigation in website user experience and search engine optimization.It not only indicates the current position for users, provides a convenient return path, but also provides important clues for the website structure of search engines.AnQiCMS takes full consideration of the intelligence, automation, and highly customizable design in the breadcrumb navigation, aiming to help operators easily build a clear website hierarchy.### The core logic and default behavior of AnQiCMS breadcrumb navigation In AnQiCMS

2025-11-06

How will the breadcrumb navigation dynamically update when the content category or structure of the AnQiCMS website is adjusted?

As a senior website operation expert, I know that a highly efficient and intelligent content management system plays a decisive role in the success of a website.AnQiCMS (AnQiCMS) has won a lot of praise in the content operation field with its efficient features of Go language and excellent functional design.Today, let's delve deeply into a seemingly minor but crucial feature for user experience and SEO - breadcrumb navigation, particularly focusing on how AnQiCMS cleverly implements its dynamic updates when the website's content categories or structure is adjusted.### AnQiCMS

2025-11-06

Does AnQiCMS breadcrumbs navigation automatically handle and adapt to the path of multilingual websites?

AnQiCMS (AnQiCMS) is a solution for enterprise-level content management and global promotion, always committed to providing high flexibility and automation in the design of detailed features.When it comes to the automatic handling and adaptability of breadcrumb navigation in multilingual website paths, AnQiCMS shows its thoughtful architecture.### AnQiCMS's Global Perspective and Multilingual Foundation Firstly, we need to understand that AnQiCMS has always regarded 'multilingual support' as one of its core highlights from the beginning of its design

2025-11-06

What is the difference in the generation logic of AnQiCMS breadcrumb navigation on article detail pages and category list pages?

## AnQiCMS breadcrumb navigation: What is the difference between the generation logic of the article detail page and the category list page?In a content management system, breadcrumb navigation is one of the key elements for user experience and search engine optimization (SEO).It displays the user's position on the website in a clear path, not only helping users quickly understand the structure of the website but also effectively improving the usability of the website and the crawling efficiency of search engines.As an experienced website operations expert, I deeply understand the exquisite design of AnQiCMS in this detail.

2025-11-06

How to exclude certain pages from displaying breadcrumb navigation in AnQiCMS using conditional judgment?

As an experienced website operations expert, I am well aware of the importance of breadcrumb navigation in enhancing user experience and website SEO.It can not only help users clearly understand their current location, but also assist search engines in understanding the structure of the website.However, in certain specific scenarios, we may want some pages not to display breadcrumb navigation, such as the homepage, login page, registration page, or some special marketing landing pages, in order to maintain the simplicity of the page or highlight the core content.AnQiCMS (AnQiCMS) provides us with a perfect tool to meet this requirement with its flexible and powerful template engine

2025-11-06

How to use AnQiCMS breadcrumb navigation with other logical tags in Django template engine (such as `for`, `if`)?

## AnQi CMS: Make smart and efficient breadcrumb navigation using Django template tags As a senior website operations expert, I deeply understand the indispensable role of breadcrumb navigation (Breadcrumb Navigation) in website user experience (UX) and search engine optimization (SEO).It can clearly show the user's current position on the website, guide the user to conveniently backtrack the path, and also help search engines understand the hierarchical structure of the website, improve crawling efficiency and ranking.

2025-11-06

What is the specific performance and configuration method of AnQiCMS breadcrumb navigation in single-page (Page) type content?

As an experienced website operations expert, I know the importance of breadcrumb navigation in enhancing user experience and optimizing search engine rankings (SEO).It can clearly show the user's current position on the website, avoid getting lost, and also help search engines understand the hierarchy of the website.Today, let's delve into the specific performance and flexible configuration methods of breadcrumb navigation in AnQiCMS for single-page (Page) content type.

2025-11-06