In the daily operation of AnQiCMS, navigation settings are a key component of website structure and user experience.Many operators will pay attention to a practical issue: if there is no content under the sub-navigation, will it automatically hide?As a website operator who is well-versed in the operation mechanism of AnQiCMS, I can delve into and answer this question.

The navigation management system of AnQi CMS provides a flexible mechanism that allows us to define the menu structure of the website, including the main navigation, sub-navigation, and other levels.In the "Website Navigation SettingsThese navigation links can point to built-in pages, category pages, or any external links, which gives us a high degree of freedom in website structure design.

However, it should be clarified that the core system of Anqi CMS will not automatically judge whether the sub-navigation has actual content at the content level and hide the navigation items accordingly.When we configure a sub-navigation in the background, we specify a target link (such as a category page) for it and assign it a display name.CMS itself will not track in real-time whether the content entity associated with the target link (such as the articles under this category) exists or is empty.Therefore, even if there are no articles under a category, the sub-navigation link pointing to that category will still be enabled in the background, and it will still be displayed on the front end of the website if the front-end template does not make special handling.

Sub-navigation is automatically hidden, and the decision-making power mainly lies in the frontend template design. The template tags of Anqi CMS, such asnavListAllow developers to traverse and render the navigation structure programmatically.In the practice of template development, to ensure the simplicity and accuracy of the user interface, template designers will use conditional judgment statements to check whether the sub-navigation indeed contains valid sub-items.navListLabels will be provided for each navigation item when returning the navigation listNavListProperty, if the navigation item has a sub-navigationNavListThis will be an array containing sub-navigation data; if there are no sub-navigations, it will be empty.

Experienced template designers will utilize this feature to add similar when rendering navigation.{%- if item.NavList %}Such judgment. Only whenitem.NavListthis array is not empty (i.e., there are child navigation items) will it render the wrapper for the child navigation.<ul>or<div>HTML structure. This way, even if the background configuration has an "empty" sub-navigation (i.e., all its sub-links have been deleted or there is no content under the category it points to), sinceNavListThe content is empty, and the front-end template will not generate any visible HTML elements for it, thus achieving the effect of "auto-hidingThis design concept separates content from display logic, giving the template greater flexibility and control.

Therefore, as a website operator, when we find that there are sub-navigation without content on the website, the focus we should pay attention to is not whether the AnQi CMS system automatically hides it, but to check whether the current website's frontend template has properly handled this situation.An excellent template will anticipate and handle these details, ensuring that website navigation remains professional and practical through clever template logic, avoiding empty navigation items to provide an excellent user experience.

Common Questions and Answers (FAQ)

1. How can I ensure that empty sub-navigation does not display on the front end in AnQi CMS?

The Anqi CMS system itself does not automatically hide empty sub-navigation.You need to make sure that the frontend template used by your website contains appropriate conditional logic to handle this situation.{% if item.NavList %}This tag is used to check if the parent navigation item has an actual child navigation list, and the corresponding HTML structure will only be rendered when a child list exists.If you find that empty sub-navigation is still displayed, you may need to contact the template developer to adjust it, or check the corresponding code in your own template.

2. Will AnQi CMS automatically remove navigation links pointing to empty categories or pages?

Would not.The navigation settings of AnQi CMS are configured independently of whether the actual content exists.Even if a navigation link points to a category or a single page that currently has no content, the navigation link itself will still exist in the background, and if the front-end template does not perform special judgment and processing, it will continue to be displayed on the front end.The system will not automatically delete or hide these links.

3. What happens if my navigation link points to a non-existent page?

If the navigation link points to a page that does not actually exist on the website (for example, the page has been deleted, or the link address is incorrect), the user will usually see the website's 404 error page when they click on the link.The AnQi CMS does not automatically recognize and remove navigation links pointing to invalid pages; this requires regular checks and maintenance of the validity of navigation links by operation personnel.