In the vast ocean of information on the website, breadcrumb navigation is like a guiding light, it can not only clearly tell the user where they are, but also greatly improve the usability of the website and the search engine optimization (SEO) effect.For enterprise websites built using AnQiCMS, ensuring that the breadcrumb navigation path is consistent with the website's pseudo-static URL structure is a key step in achieving these goals.This not only concerns the user experience, but is also the foundation for search engines to understand the structure of websites and improve crawling efficiency.
Understand the pseudo-static URL mechanism of AnQiCMS
First, let's briefly understand how AnQiCMS handles URL structure. The pseudo-static URL is not a real static file, but it is simulated through server rewrite rules to mimic the path of a static file for dynamic page addresses, for example, by convertingarticle.php?id=123changes to/article/my-great-post.html. This form of URL is more friendly to search engines and more readable.
AnQiCMS knows the importance of URL structure for SEO and therefore provides a powerful static configuration function.The system is built with several commonly used static rules, such as by numeric ID, model naming, or category naming, these preset plans can meet the needs of most websites.{id}/{filename}/{catname}/{module}Build a unique URL path.No matter which mode you choose, the core principle is that once set in the AnQiCMS backend, these rules become the authoritative definition of your website URL.Every link on your website will strictly follow these rules generated.
AnQiCMS intelligent integration of breadcrumb navigation.
The breadcrumb navigation feature of AnQiCMS provides an intuitive and intelligent implementation at the template level. You do not need to manually write complex logic to parse the URL and concatenate the path, the system has built-inbreadcrumbThe tag will complete this task for you.
In your front-end template file, you usually just need to embed{% breadcrumb crumbs %}This tag to get the complete breadcrumb path list of the current page. ThiscrumbsA variable will return an array containing multiple items (item), eachitemareName(link name) andLink(link address) two key properties. The most clever thing is,item.Linkthe URL generated by the properties willAutomatically sync with the pseudo-static rules configured on the backendThis means that as long as your pseudo-static rules are set properly, the breadcrumb navigation links will match seamlessly. In addition, you can also customize the display name of the home page throughindexparameters to customize the display name of the home page and throughtitleParameters control whether the current document title is displayed on the document detail page, providing users with more accurate and personalized navigation experience.
Ensure the core strategy for consistency of path
Ensure that the AnQiCMS breadcrumb navigation path is consistent with the website's static URL structure, we need to coordinate at both the background configuration and the front-end template calling levels.
The first step: Clearly define the pseudo-static rules in the AnQiCMS background
The first and most basic step is to go to the "Function Management" area of the AnQiCMS backend, find the "Static Rule" settings.Here, you need to clearly define the URL structure of your website.You can choose from preset number patterns, model naming patterns, or enable "custom mode" for precise planning based on site characteristics.
For example, if you want the URL of the article detail page to be/article/{filename}.htmland the category page is/category/{catname}.htmlThe rule should be configured here. The key is to understand and correctly use the variables in the rule:
{id}: The unique ID of the content.{filename}Corresponds to the "custom URL" for documents, single pages, or tags (url_token) field.{catname}Corresponds to the "custom URL" for categories (url_token) field.{module}The corresponding "URL Alias" field in the content model settings.{page}Used for pagination URLs, usually placed in parentheses as optional, such as(/{page}).
These variables are the keys to dynamically generate URLs, ensuring they match the custom alias fields in your content management.Once the pseudo-static rules are configured and saved, AnQiCMS will generate all external links according to these rules.
Step two: Set custom URL aliases reasonably in content management
Next, when you create or edit articles, products, categories, tags, or single pages, AnQiCMS will provide the option of 'custom URL' or 'URL alias'. The value of this field will be directly mapped to the static rules in pseudo-static rules.{filename}or{catname}Variables
For example, when you publish an article named "AnQiCMS SEO Guide", the system will automatically generate a pinyin alias such asanqicms-weijingtai-zhinan. If you use pseudo-static rules{filename}the final URL might be/article/anqicms-weijingtai-zhinan.html.Ensure that these custom URLs maintain uniqueness and standardization, avoiding Chinese characters, special characters, and spaces to ensure that the generated URLs are neat and有利于SEO.