How to create the main navigation of the website in AnQi CMS?

Calendar 👁️ 56

The website's main navigation is the key for users to browse and understand the website structure.It guides users to access important content, optimizes user experience, and plays an important role in search engine optimization (SEO).AnQi CMS provides flexible and powerful navigation management functions, allowing users to easily create, edit, and publish the main navigation that meets their business needs.

Overview of AnQi CMS navigation management function

The AnQi CMS backend navigation settings module centrally manages the website's navigation links.This module not only supports configuring default top navigation, but also allows users to create custom navigation locations according to their actual needs, such as footer navigation or sidebar navigation.The system supports up to two levels of navigation links, namely the primary navigation and the first-level sub-navigation, providing a clear structural hierarchy for the website.

Create custom navigation categories

In addition to the navigation categories provided by the system by default, users can create new navigation categories according to business needs.For example, if the website needs an independent footer navigation area, a new category named 'Footer Navigation' can be added in the navigation settings.This classification management method allows navigation content in different regions to be independently configured and called, thereby increasing the flexibility of the website layout and avoiding the situation where all navigation items are squeezed into the same default navigation list.

Add and configure navigation links

Adding a navigation link is the core step in building the main navigation of a website.In the AnQi CMS backend navigation settings interface, users can configure multiple information items for each navigation link to ensure correct display and functionality on the front page.

FirstlyParent navigationThe setting allows the user to set the current link as a top-level navigation (first-level navigation) or to belong to an existing first-level navigation, thereby forming a second-level navigation.The AnQi CMS currently supports this two-level navigation structure, which can meet the hierarchical needs of most websites.

secondly,display nameIs the navigation link text displayed on the front page, which can be named flexibly according to actual needs and does not necessarily need to be consistent with the link content. If it is necessary to display bilingual titles for navigation items or provide additional explanations, you canSubheading nameEnter the corresponding content in the field. At the same time,Navigation descriptionThe field is used to provide a brief introduction for navigation items. These descriptions can be called in the front-end template to display, providing users with more contextual information.

InLink TypeIn terms, AnQi CMS supports various options to meet different content needs: Built-in links: Include links to the website homepage, article model homepage, product model homepage, and other custom content model homepages, making it convenient for users to quickly specify common entry points. Category page link: Users can select a document category or single page created from the backend as a navigation link, which allows the actual content in the content management system to be directly used as a navigation item.External links: Allow users to add any URLs within or outside the site as navigation links, providing great flexibility, and can link to third-party services or external resources.

Finally, by settingDisplay orderthe number to determine the order of navigation link arrangement, the smaller the number, the earlier the display position. Currently, this feature is sorted by number and does not support drag operations.

Navigate the main navigation in the front-end template

The display of the main navigation ultimately depends on the configuration of the front-end template file. Anqi CMS uses specialnavListLabel to retrieve and render the navigation list. Developers can use it in template files.{% navList navs %}The tag to retrieve navigation data. This tag will return an array object containing navigation items (for example namednavs), and then you can iterate throughnavsvariable to output the navigation links.

An example of a typical two-level navigation rendering code that demonstrates how toitem.NavListflexibly display or hide sub-navigation menus based on

{% navList navs %}
<ul>
    {%- for item in navs %}
        <li class="{% if item.IsCurrent %}active{% endif %}">
            <a href="{{ item.Link }}">{{item.Title}}</a>
            {%- if item.NavList %}
            <dl>
                {%- for inner in item.NavList %}
                    <dd class="{% if inner.IsCurrent %}active{% endif %}">
                        <a href="{{ inner.Link }}">{{inner.Title}}</a>
                    </dd>
                {% endfor %}
            </dl>
            {% endif %}
        </li>
    {% endfor %}
</ul>
{% endnavList %}

This code will generate an unordered list containing top-level navigation items.If a top-level navigation item has sub-navigation, a nested definition list (dl) will be generated to display its secondary sub-navigation items.

Advanced application examples of navigation

The navigation tags of AnQi CMS also support more complex application scenarios.For example, you can directly display the list of popular products under a category in the secondary menu of the main navigation, or display the list of subcategories under the category.

When you need to display a list of products in a specific category in the navigation dropdown menu, you can combine it within the second-level navigation itemarchiveListto call the tag. According to the second-level navigation item'sPageId(If the navigation item is associated with a category or page), utilizingarchiveListlabel and specifycategoryIdto obtain the corresponding product documentation, thus directly displaying the content in the navigation.

Similarly, if you want to display the subcategories of a category in the navigation dropdown menu, you can use the secondary navigation items.PageIdthrough.categoryListThe label retrieves and displays its subcategory list. This function of embedding content lists or category lists into navigation makes the navigation not only a collection of links but also an entrance for content display, greatly enhancing the efficiency and experience of users discovering content.

Notes for creating and managing navigation.

When creating and managing the website's main navigation, make sure the navigation structure is logical, in line with user browsing habits, so that users can easily find the information they need.Considering SEO factors, it should be avoided to use too deep navigation levels to facilitate search engine crawling and understanding of the website structure.Regularly check the validity of all navigation links to prevent dead links, as this not only affects user experience but also harms the website's SEO performance.In addition, if the website has enabled multi-site management functionality, please pay attention when calling the navigation tagsiteIdThe use of parameters to ensure the navigation data of the correct site is called. The setting of the navigation display order should be cautious to ensure that the navigation items are arranged as expected.


Frequently Asked Questions

  • How many levels of website main navigation does AnQi CMS support?AnQi CMS currently supports up to two levels of website main navigation, namely level one main navigation and level one sub-navigation.

  • How to direct navigation links to a specific article category or single page?When adding or editing navigation links in the Anqi CMS backend, select 'Category Page Link' in the 'Link Type' option, and then you can select a created article category or single page as the navigation target from the dropdown menu.

  • Can I directly display the list of articles under a certain category in the navigation dropdown menu?Yes. You can combine it with the front-end template,navListTags andarchiveListto achieve this feature. InnavListWhen traversing the second-level navigation items, use thePageIdparametersarchiveListtags to specify the corresponding category ID and call the article or product document list under the category.

Related articles

How to use the recommended attributes (H, C, F, A, S, P, J) of AnQi CMS document and what impact does it have on front-end display?

As an experienced CMS website operation person, I know the core position of content in website operation.The document recommendation feature provided by AnQi CMS is a powerful tool for us to efficiently manage and optimize content, accurately reach users, and thus improve the website's performance.These properties are not only tags for content classification, but also the key to guiding front-end content display and optimizing user experience.

2025-11-06

What are the specific steps to introduce MathJax and Mermaid plugins in Anqi CMS template?

As a senior Anqi CMS website operation personnel, I am well aware that providing rich and professional display forms is crucial for attracting and retaining users in an increasingly complex network content environment.For websites that contain technical content, scientific formulas, or flowcharts, the MathJax and Mermaid plugins can greatly enhance the readability and professionalism of the content.

2025-11-06

How to enable Markdown editor and display mathematical formulas and flowcharts correctly in AnQi CMS?

As an experienced website operator, I know that the diversity of content forms is crucial for attracting and retaining users.AnQiCMS is an efficient content management system that not only provides powerful content publishing and management functions, but also keeps up with the trend of technology, supports Markdown editor, and greatly improves the efficiency and expressiveness of content creation.

2025-11-06

How to add JS automatic submission code for search engines like 360 and Toutiao in Anqi CMS?

AnQi CMS, as an efficient and SEO-optimized content management system, fully understands the importance of website content being indexed by search engines in a timely manner.Although for major search engines like Baidu and Bing, we can implement active push through API interfaces to accelerate inclusion, but in the face of platforms mainly relying on JavaScript code for automatic submission, such as 360 Search and Toutiao, Anqi CMS also provides a simple solution.

2025-11-06

How to add footer navigation menu in AnQi CMS?

As an experienced security CMS website operator, I know that a perfect website is not only about exciting content, but also about every detail of user experience.The footer navigation menu, although seemingly insignificant, plays a crucial role in enhancing website usability, optimizing SEO structure, and guiding users to explore the content in depth.It usually contains important links of the website, such as About Us, Contact Information, Privacy Policy, etc., allowing users to quickly find the information they need on any page.

2025-11-06

Does AnQi CMS support custom navigation categories, such as sidebar navigation?

As a senior security CMS website operations personnel, I am well aware of the key role of website navigation in enhancing user experience and content presentation.An efficient and flexible navigation system not only helps users find the information they need quickly, but is also an important part of optimizing the website's information architecture.In AnQi CMS, regarding the support for custom navigation categories, especially for sidebar navigation needs, I can clearly tell you that the system provides powerful and flexible features to meet these customization requirements.

2025-11-06

How to set the AnQi CMS navigation link to display as a first-level or second-level menu?

As a senior CMS website operation personnel of an information security company, I know that a clear and efficient navigation system is of great importance to a website, as it not only directly affects user experience, but is also an indispensable part of search engine optimization (SEO).In Anqi CMS, setting the navigation link as a first or second-level menu is a relatively simple but powerful operation that can help you flexibly construct the website structure. I will elaborate in detail on how to set up and manage navigation links in Anqi CMS to display first-level and second-level menus.

2025-11-06

What is the difference between the 'Display Name' and 'Subtitle Name' of the AnQi CMS navigation link?

As an experienced CMS website operation personnel, I know the core position of navigation links in website structure and user experience.Each element, from displayed text to hidden attributes, carries the important responsibility of guiding users and optimizing information communication.Today, let's delve deeply into the functions of "Display Name" and "Subtitle Name" in the Anqi CMS navigation settings, which seem similar but actually serve different purposes. --- ### What is the difference between the "display name" and "subtitle name" of AnQiCMS navigation links?In the AnQi CMS backend navigation settings

2025-11-06