In website operation, providing clear navigation paths for visitors and optimizing the crawling efficiency of search engines is a key link to improve user experience and website SEO performance.This Breadcrumb Navigation is a feature that can visually display the hierarchical position of the current page and provide a convenient return path.For websites built using AnQiCMS, we can conveniently utilize its built-in features to automatically generate and display breadcrumb navigation that complies with SEO standards.

How does Anqi CMS implement breadcrumb navigation?

AnQi CMS was designed with full consideration of the website's SEO-friendliness and content operation efficiency. Its built-in template tag system provides a namedbreadcrumbThe tag is specifically used to dynamically generate breadcrumb navigation in the page.This means that you do not need to manually maintain complex navigation paths for each page, the system will automatically build the complete hierarchy based on the current page's category, document, or single-page properties.This automated capability greatly reduces the workload of website maintenance and ensures consistency in navigation.

When a user visits a deep page on a website, the breadcrumb tag of AnQi CMS can intelligently identify all the intermediate links from the homepage to the current page and display them as links.For example, if a document is located at a level such as “Product > Electronic Products > Phone”, the breadcrumb navigation will display as “Home > Product > Electronic Products > Phone”.

The SEO advantages of breadcrumb navigation

The SEO value of breadcrumb navigation automatically generated by Anqi CMS is mainly reflected in the following aspects:

  1. Enhancing user experience and site navigation: Clear breadcrumb navigation helps users quickly understand the website structure and reduces the feeling of being lost.Users can easily click on any upper-level link to return to a higher-level page, enhancing the website's usability.A good user experience can indirectly affect the search engine ranking.

  2. Optimize the internal link structure.: Each link in the breadcrumb navigation is a valid link pointing to an internal page of the website.These internal links help search engine spiders better discover and index the deep pages of a website, and pass on page authority, thereby improving the overall link structure and SEO weight of the website.

  3. Improve search engine understanding:Breadcrumb navigation provides a structured way to present the hierarchical relationship of a website.The search engine will read this information, understand the content organization of the website more accurately, which helps to improve the visibility and relevance of the website in the search results.AnQi CMS emphasizes 'high-performance architecture', 'static caching and SEO optimization' and other technical highlights, ensuring that the breadcrumb navigation not only generates efficiently, but also that the generated links comply with the practice of search engines.

  4. Comply with SEO standard URL structure: Anqi CMS supports flexible pseudostatic and 301 redirect management, allowing you to customize the URL structure.When breadcrumb navigation is combined with these SEO-friendly URL structures, each navigation item's link will be concise, meaningful, and conducive to search engine crawling, further enhancing the SEO effect.

Integrate breadcrumb navigation in the template

To display breadcrumb navigation on your AnQi CMS website page, you need to include the corresponding template file.breadcrumbLabel. Based on the template, the common page header or general layout file (such asbash.html, or inpartialUnder the directoryheader.htmlIt is an ideal location for placing breadcrumbs navigation because it usually appears on every page of the website.

You can find your template directory, usually in./templateUnder the path, then find the layout file in the folder of the template you are currently using.

In the layout file, you can use the following code snippet to automatically generate and display breadcrumb navigation.

<nav aria-label="breadcrumb">
    <ol class="breadcrumb">
        {% breadcrumb crumbs %}
        {% for item in crumbs %}
            <li class="breadcrumb-item{% if forloop.Last %} active{% endif %}">
                {% if forloop.Last %}
                    <span>{{item.Name}}</span>
                {% else %}
                    <a href="{{item.Link}}">{{item.Name}}</a>
                {% endif %}
            </li>
        {% endfor %}
        {% endbreadcrumb %}
    </ol>
</nav>

This code first declares a<nav>element, and witharia-labelattribute, which helps improve accessibility. It uses an ordered list internally<ol>to carry the breadcrumb items.

  • {% breadcrumb crumbs %}: This is the core label, which generates an array variable namedcrumbsAn array object that includes all navigation paths from the home page to the current page.
  • {% for item in crumbs %}:TraversecrumbsEach navigation item in the array.
  • forloop.LastThis is a built-in loop variable used to determine whether the current item is the last one in the loop.For breadcrumb navigation, the last item should not be a clickable link, but just display the name of the current page.
  • item.Name: indicates the display name of the current navigation item.
  • item.Link: indicates the link address of the current navigation item.

Custom and Advanced Settings

Of Security CMSbreadcrumbTags also provide some parameters for you to control more finely according to your needs:

  • indexParameter: Used to customize the display text of the 'Home' in the breadcrumb navigation. For example, if you want to display 'Home' as 'Website Homepage', you can set it like this:

    {% breadcrumb crumbs with index="网站主页" %}
    
  • titleParameter: Control whether the title of the current page is displayed in the breadcrumb navigation or displayed as custom text. By default, the title of the current page is displayed (title=true)。If you do not want to display the current page title, you can settitle=false:

    {% breadcrumb crumbs with title=false %}
    

    If you want to display a generic title for the current page, such as "Article Details", you can set it like this:

    {% breadcrumb crumbs with title="文章详情" %}
    
  • siteIdParameterThis parameter is quite useful in multi-site management scenarios. If you are operating multiple sites and need to generate breadcrumb navigation from the data of other sites, you can specifysiteIdTo implement. Generally, it is not necessary to set this parameter, the system will automatically identify the current site.

With these flexible configurations, you can ensure that your website not only has a well-functioning breadcrumb navigation but also fully conforms to your brand style and SEO strategy.Combine the powerful static rules configuration of Anqi CMS, your breadcrumb navigation links will become more concise and semantic, thereby improving the website's performance in search engines.


Frequently Asked Questions (FAQ)

Q1: Will the display of breadcrumb navigation affect the loading speed of the website?

A1: I do not know. The breadcrumb navigation of Anqi CMS is automatically generated based on template tags, its logic is very lightweight, and it is rendered on the server side.The high performance characteristics of the Go language and the system's built-in static cache mechanism ensure that page generation and loading speeds are extremely fast, the impact on the overall performance of the website can be ignored.

Q2: Can I customize the breadcrumb navigation style?

A2: Of course. The template code provided above usesbreadcrumbandbreadcrumb-itemThe class names. You can control the font, color, spacing, background, and all visual representations of the breadcrumb navigation by defining the style rules of these class names in your website's CSS file, making it perfectly blend with your website's design style.

Q3: Do I still need breadcrumb navigation if my website structure is flat and has few levels?

A3: Even if the website structure is relatively flat, breadcrumb navigation still has its value.It can at least display the path of "Home > Current Page", providing the user with a clear starting and ending point.Moreover, even simple breadcrumbs can help search engines better understand the logical structure of your website, which is always a positive SEO signal.