As a website operator who deeply understands the operation of AnQiCMS, I know the importance of flexibly managing website content without touching the template code, especially core elements like the top navigation.AnQiCMS was designed with this in mind, providing an intuitive and powerful back-end management interface that allows you to easily customize and adjust the top navigation of the website without writing a single line of code.
AnQiCMS separates the navigation data of the website from the display logic of the front-end template. This means that the template files (usually usingnavListSuch a label is only responsible for 'asking' what navigation items the system has and how to display them, while the specific content, links, sorting information, and other navigation items are all managed by the backend.This design greatly improves the flexibility of website operation, making content adjustment simple and quick.
Access and configure the website navigation
To modify the default top navigation of AnQiCMS, you first need to log in to the website's backend management interface.In the left menu bar, find and click the "Background Settings" option.In the expanded submenu, you will see an entry named 'Navigation Settings', click on it to enter the navigation management page.This is the center where you manage all website navigation.
Navigation Category Management
On the "Navigation Settings" page, you will see a "Navigation Category Management" section.AnQiCMS provides a category named 'Default Navigation' by default, which is usually the category referred to by your website's top navigation.If you need to create independent navigation for the footer, sidebar, or other locations, you can create more navigation groups by clicking "Add Navigation Category", for example, "Footer Navigation".In this way, you can configure completely independent navigation structures for different areas of the website.
Carefully set navigation links
After entering the "Default Navigation" category, you will see a list of all current navigation links.Here, you can perform operations such as adding, editing, and deleting navigation items.When you click "Add new navigation" or edit an existing navigation link, a configuration form will pop up, which includes multiple key fields that allow you to define each navigation item in detail.
The first is the "parent navigation" field. AnQiCMS supports up to two levels of 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 (second-level navigation), then select the corresponding main menu as its parent navigation.
The name to be displayed here, this is the text displayed on the front page navigation link, you can modify it 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 brief descriptions to navigation items, which may be used on the front end to generate tooltips or as auxiliary information.
The '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', 'Product Model Home Page' or other custom model home pages that you have created on your website.Select these types to ensure that the link always points to the correct internal system page.
- Category page links:If you want the navigation link to point to a specific document category or a custom single-page, you can select this type.The system will list all your categories and single pages for you to select, ensuring the accuracy of the links.
- External links:This type offers you the greatest flexibility, allowing you to manually input any URL, whether it is a specific article within the site, a product detail page, or a link to an 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 arrangement 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 template, for example, the default theme includesheader.html(usually contains the top navigation), it will use{% navList navs %}This tag dynamically fetches navigation data from the background. ThisnavListTags usually have atypeIdparameter that specifies which category of navigation data to pull, for example{% navList navs with typeId=1 %}Indicates obtaining the default navigation category with ID 1.
When you make any changes to the links under the "Default Navigation" category in the "Navigation Settings" backend - whether adding, deleting, editing text, changing link type, or adjusting the display order - these changes will be saved to the database. In the frontend template,navListThe tag will query these latest data in real time when the page is loaded. Therefore, as long as your template file uses the correctnavListtag and specifies the correcttypeId(通常是默认导航),All navigation modifications you make in the background will be immediately reflected on the front page of the website, without the need to manually modify any line of template code.
This design, which separates content from presentation, not only lowers the threshold for website operations, but also greatly improves the maintainability and update efficiency of the website.As an operations person, 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 page did not display the update immediately, why is that?A1: AnQiCMS may have a caching mechanism to improve performance.If your changes do not take effect immediately, please try to find the 'Update Cache' button at the top right 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 refresh the page forcibly (Ctrl+F5 or Shift+F5) or clear the browser cache.
Q2: I want to place a set of independent navigation menus at the footer of the website, how should I operate?A2: You can navigate to the 'Navigation Settings' page and click on the 'Navigation Category Management' feature to add a new navigation category, such as creating a new category named 'Footer Navigation'.Then, add the navigation links you want to display in the footer under this new category.After that, find the corresponding footer file in your theme template (for examplefooter.html),and use{% navList footerNavs with type="页脚导航" %}(Assuming your new category ID or name is "Footer Navigation") such a label to call this new navigation category data.This usually requires you to have a basic understanding of the template structure, but it still belongs to configuration rather than code modification.
Q3: Can I directly add a link in the 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 your website's static rule changes, causing these links to fail, you just need to update the corresponding URL in the navigation settings.