As a website operator who is well-versed in the operation of AnQiCMS, I am well aware of the importance of flexibly managing website content without touching the template code, especially for core elements like the top navigation.AnQiCMS was designed with this in mind from the beginning, providing an intuitive and powerful backend management interface, allowing you to easily customize and adjust the top navigation of the website without writing a single line of code.

AnQiCMS has effectively separated the navigation data of the website from the display logic of the front-end template. This means that the template file (usually usingnavListThis label is responsible for "inquiring" what navigation items the system has and how they are displayed, while the specific content, links, sorting information, and so on are all managed by the backend.This design greatly enhances the flexibility of website operation, making content adjustments simple and quick.

Access and configure the website navigation

You need to log in to the website's backend management interface first to modify the default top navigation of AnQiCMS.In the left menu bar, find and click the "Backend Settings" option.In the expanded submenu, you will see an entry named "Navigation Settings", click it to enter the navigation management page.This is the center where you manage all website navigation.

Navigation Category Management

On the "Navigation SettingsAnQiCMS defaults to providing a category named “default navigation”, which is usually the category referred to by the top navigation of your website.If you need to create independent navigation for the footer, sidebar, or other locations, you can create more navigation groups by clicking on "Add Navigation CategoryThrough this method, you can configure a completely independent navigation structure for different areas of the website.

Carefully set navigation links

The first is the 'Parent Navigation' field.AnQiCMS supports up to two-level navigation menus.If your navigation item is the main menu (level 1 navigation), please select 'Top-level Navigation'; if it is a submenu under a main menu (level 2 navigation), then select the corresponding main menu as its parent navigation.

The navigation link text displayed on the front page can be freely modified as needed.If you want the navigation item to have a subtitle, for example to display both Chinese and English at the same time, you can use the 'Subtitle Name' field.In addition, the "navigation description" field allows you to add a brief description to navigation items, which may be used on the front end to generate tooltips or as auxiliary information.

“Link type” is the core of defining navigation behavior. AnQiCMS provides three main link types:

  • Built-in Links:This type includes predefined links, such as "Home Link" and the "Article Model Home Page" or "Product Model Home Page" that you have created on your website, as well as other custom model home pages.Selecting these types ensures that the link always points to the correct internal system page.
  • Category page link:If you want the navigation link to point to a specific document category or a custom single page, you can choose this type.The system will list all your categories and single pages for selection, ensuring the accuracy of the links.
  • External links:This type gives you the greatest flexibility, allowing you to manually enter any URL, whether it is a specific article, product detail page within the site, or a link to another external website.This is very useful for guiding users to access specific content or promote partner websites.

Finally, the "Display Order" field allows you to control the order of navigation items by entering numbers. The smaller the number, the earlier the navigation item is displayed in the list.

The principle of not changing the template code

AnQiCMS templates, such as the default themeheader.html(usually includes the top navigation), will use{% navList navs %}This label is used to dynamically retrieve navigation data from the backend. ThisnavListlabel usually has atypeIdparameter that specifies which category of navigation data to pull, for example{% navList navs with typeId=1 %}Represents retrieving the default navigation category with ID 1.

When you make any changes to the links under the "Default Navigation" category in the "Navigation Settings" on the backend—whether adding, deleting, editing text, changing link types, or adjusting the display order—these changes will be saved to the database by the system. In the frontend templates,navListThe label will query and render these latest data in real time when the page loads. Therefore, as long as your template file uses the correctnavListlabel and specifies the correcttypeId(通常是默认导航),您在后台所做的所有导航修改都将立即反映在网站的前端页面上,而无需您手动修改任何一行模板代码。

This design of separating content from presentation not only lowers the threshold for website operation, but also greatly enhances the maintainability and update efficiency of the website.As an operator, you just need to focus on content organization and user experience optimization, without worrying about complex code issues.

Frequently Asked Questions

Q1: I modified the navigation settings, but the front-end page did not display the update immediately, why is that?A1: AnQiCMS to improve performance, there may be a caching mechanism.If your changes do not take effect immediately, please try to find the 'Update Cache' button at the top right corner or bottom of the background management interface and click to clear the cache.In addition, browser cache may also cause display delay. You can try to force refresh the page (Ctrl+F5 or Shift+F5) or clear the browser cache.

Q2: How should I operate to place an independent navigation menu in the footer of the website?A2: You can create a new category named "Footer Navigation" by clicking on "Add New Navigation Category" under the "Navigation Category Management" feature on the "Navigation Settings" page.Then, add the navigation links you want to display in the footer under this new category.footer.html) and used{% navList footerNavs with type="页脚导航" %}(Assuming your new category ID or name is "Footer Navigation") use such a label to call this new navigation category data.This usually requires a basic understanding of the template structure, but still falls under the category of configuration rather than code modification.

Q3: Can I add a link directly in navigation to a specific product detail page or article detail page?A3: OK.When adding or editing navigation links, you can select the 'External Link' type and then directly paste the complete URL of the product or article detail page into the link address field.AnQiCMS will treat this external link as a normal navigation item.If the pseudo-static rules of your website change, causing these links to fail, you only need to update the corresponding URL in the navigation settings.