As a website operator proficient in the APT CMS content management system, I am well aware of the importance of an efficient and user-friendly website navigation for visitor experience and information communication.In the AnQi CMS, adding a single-page link to the website navigation is a common and basic operation. It helps you clearly present independent content pages such as "About UsNext, I will elaborate on the entire process of adding a single-page link in the website navigation.
Add a single page link in website navigation
The website navigation is the key path for users to explore the website content. A clear and intuitive navigation system can greatly enhance the user experience.In Auto CMS, you can easily integrate the created single-page content into the main navigation or other custom navigation of the website.
Firstly, add a single-page link to the navigation in the AnQi CMS, the core steps include creating the single-page content, then adding this link item to the navigation settings, and finally ensuring that the template correctly calls the navigation data.
First step: Create or edit single page content
Before adding a single-page link to the navigation, you need to make sure that the single page itself already exists and has been published.Please login to the Anqi CMS backend management interface, find the "Page Resources
Second step: Access website navigation settings
The single page content is ready, and the next step is to add it to the website navigation.Return to the AnQi CMS backend main interface, find the "Backend Settings
Third step: Add new navigation link
In the pop-up "Add Navigation Link" form, you need to configure the parameters of the new link.In the "Link TypeSelect this type and the system will display a page with a list of available categories.From this list, find and select the single page you created or edited in the first step.
Then, fill in the "Display Name" for this navigation link, which is the text that users see in the website navigation.If your design requires, you can also fill in "Subheading Name" and "Navigation Description" to provide more information.To control the display order of links in navigation, please set the 'Display Order' field, where a smaller number indicates a link position closer to the front.If this single-page link is a submenu of a main navigation item, you also need to select its main navigation item in the 'Parent Navigation'.After completing all configurations, click Save, and your single-page link will be successfully added to the navigation data.
Fourth step: Call navigation data in the template
Although you have configured the navigation link in the background, it will not display on the website front-end immediately.You still need to ensure that the website template uses the navigation list tags provided by SafeCMS to call these data.navListLabel to get navigation data and render.
In most cases, your website template (such as)bash.htmlorheader.html) will contain similar code snippets, used to display navigation:
{% navList navs %}
<ul>
{%- for item in navs %}
<li>
<a href="{{ item.Link }}">{{item.Title}}</a>
{%- if item.NavList %}
<dl>
{%- for inner in item.NavList %}
<dd>
<a href="{{ inner.Link }}">{{inner.Title}}</a>
</dd>
{% endfor %}
</dl>
{% endif %}
</li>
{% endfor %}
</ul>
{% endnavList %}
This code will iterate through all the navigation links set in the background, and according to their hierarchical relationship (throughitem.NavListDetermine if there is a child navigation) Generate HTML list structure. If you add a single-page link as top-level navigation, it will be displayed directly.<ul>If it is a sub-navigation, it will be displayed in the corresponding submenu. Please ensure according to the specific structure of your website template.navListThe label is correctly placed in the location where navigation needs to be displayed. If your template supports multiple navigation categories, you may need to specify through parameters which navigation category's data to call, for example,typeIdparameters to specify which navigation category's data to call, for example,{% navList navs with typeId=1 %}.
By following these four detailed steps, you can successfully add a single page link to the website navigation in AnQi CMS.This not only helps you better organize website content, but also provides clear navigation guidance for visitors, thereby improving the overall website usability and user satisfaction.
Common Questions (FAQ)
问:我已经在后台添加了单页面链接到导航,但网站前端为什么没有显示?
答:This situation usually has several reasons.Firstly, please check if you have clicked the "Update Cache" button in the background. Safe CMS caches some data to improve performance, and updating the cache ensures that the latest navigation configuration is loaded.navList标签来调用导航数据,以及是否指定了正确的typeId(If your website uses multiple navigation categories). Finally, if the link is set as a sub-navigation, please check whether its parent navigation is visible and configured correctly.
问:我可以在一个导航项下添加多个单页面链接作为下拉菜单吗?
答:Yes, AutoCMS supports multi-level navigation.When adding or editing navigation links, you can use the 'Parent Navigation' field to achieve this function.只需将您希望作为子菜单的单页面链接指定给一个已存在的顶级导航项作为其“上级导航”,系统便会在前端模板渲染时,将其显示为下拉菜单中的一项。Please ensure that your template supports rendering multi-level navigation structures.
问:除了单页面,我还可以将哪些类型的链接添加到导航中?
答:The navigation settings of Anqi CMS are very flexible, in addition to single page links (selected through the "Category Page Link" type), you can also add the following types of links:
- Built-in linkIncluding the homepage of the website and the homepage of specific content models (such as article model homepage, product model homepage).
- Category page linkEnglish: Besides single-page, you can also choose a category page that has been created as a navigation link.
- External LinkYou can flexibly enter any external URL or a specific URL path within your website to meet a wider range of link needs.