When operating a website, some seemingly simple single-page applications, such as "About UsCarefully design independent visual styles for these pages, optimize their SEO information, and flexibly display content, which is the key to improving user experience and website professionalism.AnQiCMS provides powerful and flexible features, allowing you to easily meet these needs.
Core Function: Customize Exclusive Experience for Single Page
First, let's understand how to manage and customize these single-page applications in AnQiCMS. Everything revolves around the 'Page Management' feature.
When you enter the "Page Resources" module in the background and select "Page Management", you will see a list of all single pages created.Here, you can add new single pages, or edit existing pages.Create or edit a single page and you will find that AnQiCMS provides comprehensive configuration options to ensure that each page can have its unique identification.
Content and visual independence
- Page content management:Each single page has an independent "page name", "single page introduction", and "single page content" editing area.Through the rich text editor, you can easily format text, insert images, videos, and even quote code snippets to ensure the richness and attractiveness of the content.For example, on the "About Us
- Custom URL:To make the links on a single page more semantic and identifiable, AnQiCMS allows you to set a "custom URL". The system will automatically generate a pinyin alias based on the page name you enter, but you can also manually modify it to create such as
/about-us.htmlor/contact.htmlThis link is concise and friendly. It not only helps users remember and share, but is also an important part of Search Engine Optimization (SEO). - Independent SEO information:Each single page can have exclusive SEO information, including "SEO Title", "Keywords", and "Single Page Description". These fields directly correspond to the page's
titletags,meta keywordsandmeta descriptionIt is crucial for enhancing the visibility and click-through rate of the page in search engine results.This information is meticulously crafted to help search engines better understand the page theme and attract targeted users. - Standard Link (Canonical URL):For pages that may have duplicate content or to specify the preferred version, you can set 'standard link'.This is especially useful when doing foreign trade website or have multiple similar pages, it can tell search engines which is the authoritative version of the content, avoiding weight dispersion.
Configuration of Exclusive Template
The strength of AnQiCMS lies in its flexible template mechanism. By default, all single-page applications will usepage/detail.htmlAs its display template.但如果您希望“关于我们”页面有独特的布局,而“联系我们”页面则采用另一种风格,完全可以通过自定义模板来实现。
Firstly, in your template file directory (usually/template/{您的模板文件夹}/page/In English, you can create a new HTML file, for exampleabout.html.
Next, when editing the single page 'About Us' in the AnQiCMS backend, find the 'Single Page Template' field. Here, just enter the name of the template file you just createdabout.html。After saving, when the user visits the "About Us" page, the system will automatically load and renderabout.htmlthis exclusive template instead of the default onepage/detail.html. Through this method, you can design a unique visual style for each single page of the website, perfectly fitting its content theme and brand character.
The content display and SEO optimization in practice
How to call and display content as well as SEO information in a dedicated template for a single page?AnQiCMS provides intuitive template tags, making data calls simple.
You will mainly usepageDetailandtdkThese tags.
Page content call:In
about.htmlIn this custom template, to display the title, content, and brief introduction of the "About Us" page, you can use it like thispageDetailTags:<h1>{% pageDetail with name="Title" %}</h1> <div> {% pageDetail pageContent with name="Content" %} {{ pageContent|safe }} </div> <p>{% pageDetail with name="Description" %}</p>Here,
{{ pageContent|safe }}of|safeThe filter is necessary, it indicates that the system parses content in HTML format rather than simply outputting it as plain text, ensuring that the layout effects of the rich text editor are displayed.Set SEO information:Page SEO information is usually placed in:
<head>the tag. Use:tdkLabel, you can easily call the SEO title, keywords, and description of the single-page background settings:<head> <title>{% tdk with name="Title" siteName=true %}</title> <meta name="keywords" content="{% tdk with name="Keywords" %}"> <meta name="description" content="{% tdk with name="Description" %}"> {%- tdk canonical with name="CanonicalUrl" %} {%- if canonical %} <link rel="canonical" href="{{canonical}}" /> {%- endif %} </head>siteName=trueThe site name will automatically be appended to the end of the page title, for example, "About Us - Anqi CMS". AndCanonicalUrlIt will only render when the standard link is set in the background, to avoid unnecessary code.
URL structure and pseudo-static
Custom URL alias ({filename}Combining the pseudo-static rules feature provided by AnQiCMS, you can further optimize the URL structure of a single page. Under 'Function Management' in the 'Pseudo-static Rules', you can select or customize URL patterns that comply with SEO **practices, such as setting a single page to/{filename}.htmlThe form of “About Us” page link can be like this,/about-us.htmlwhich is concise and有利于搜索引擎抓取和理解 beneficial for search engine crawling and understanding.
Summary: Flexible empowerment, enhancing value
Through AnQiCMS' 'Page Management' feature, you can not only configure independent templates for each single page of the website to achieve a differentiated visual experience, but also finely set its SEO information and content display methods.This high degree of flexibility ensures that each single page can maximize its brand promotion, information delivery, and search engine optimization, thereby enhancing the professionalism and user experience of the entire website.
Common Questions and Answers (FAQ)
1. My custom single-page template has been uploaded and selected in the background, why is the default template content still displayed on the front end?
Please check several aspects:
- Is the path and name of the template file correct?Ensure that the template file you uploaded is located
template/{您的模板文件夹}/page/The directory, and the filename (including the suffix .html) must be consistent with the content filled in the "Single Page Template" field on the backend. For example, if you have filled in theabout.htmlThen the file should betemplate/{您的模板文件夹}/page/about.html. - Do you want to clear the cache?Sometimes you need to click the 'Update Cache' feature in the AnQiCMS backend to ensure that the new template configuration takes effect.
- Template code exists syntax error?Even if the file path and name are correct, if there are syntax errors in the Django template engine within the template file, it may also lead to incorrect rendering.You can try to check the server logs to troubleshoot the specific error.
2. Will the 'Custom URL' and 'SEO Title' on a single page be automatically generated? Do I need to manually modify them?
Yes, AnQiCMS will try to automatically generate a pinyin alias for "Custom URL" after you enter the "Page Name", and use the "Page Name" as the default "SEO Title".This automatically generated content usually meets basic requirements.
However, for better SEO effects and brand consistency, we strongly recommend that you manually optimize these fields:
- **Custom URL:**