As an experienced website operations expert, I am well aware of the importance of every detail for website user experience and brand promotion.In the age of popular social media, connecting your website seamlessly with major social platforms can not only broaden the channels for information dissemination, but also enhance user interaction and brand influence.AnQiCMS (AnQiCMS) with its powerful flexibility and ease of use, provides us with an elegant solution.

Today, we will delve into how to configure contact links for social media platforms such as Facebook, Twitter, and others in the AnQiCMS backend, and present them巧妙ly on your website.

Easily connect to the social world: Configure social media contact links such as Facebook, Twitter, etc. in the AnQiCMS backend

Your website is not just an information display platform, it is also the narrator of your brand story and the center of user interaction.Connecting the website with popular social media platforms such as Facebook, Twitter, LinkedIn, and others is a key step to enhancing brand exposure, attracting traffic, and building communities.AnQi CMS is an enterprise-level content management system centered around users, deeply understands this, and provides an intuitive and efficient way to manage these important external links.

Step 1: Manage social media links in the AnQiCMS backend

One of the design philosophies of AnQiCMS is to modularize all functional modules for centralized management and efficient configuration. The setting of social media links is mainly focused on“Backend Settings” -> “Contact Information Settings”area.

  1. Locate "Contact Information Settings"Login to your AnQiCMS admin interface.In the left navigation bar, you will see the option of "background settings".Click it, then find and click "Contact Settings" in the expanded submenu.
  2. Understand Default and Extended FieldsAfter entering the "Contact Information Settings" page, you will see a series of preset contact information fields, such as contact person, phone number, address, email, and WeChat ID. It is worth noting that AnQiCMS has built-in support for some mainstream social media platform links, such asFacebook/Twitter/Tiktok/Pinterest/Linkedin/Instagram/YoutubeThis means that for these platforms, you do not need to create an additional one. You can directly enter your homepage URL in the corresponding field.
  3. Flexible to add custom social linksThe strength of AnQiCMS lies in its high customizability.If you need to add a social media platform that is not on the default list, or if you want to add multiple links for the same social platform (for example, your company has multiple Facebook pages), AnQiCMS provides a 'custom setting parameter' feature.
    • Scroll to the bottom of the page and find the 'Custom Setting Parameters' area.
    • Click the 'Add' button next to it.
    • In the popped-up form:
      • Parameter Name (FieldName)This is the unique identifier used when calling this link in the template. It is recommended to use a concise and clear camelCase naming method, for exampleFacebookPageLink/CompanyTwitterorOurBlogRSS.
      • Parameter Value (Value)Paste the full URL of your social media homepage, for examplehttps://www.facebook.com/yourpageMake sure to includehttps://prefix to ensure the validity and security of the link
      • Remark (Remark)Fill in a brief description, such as 'Company official Facebook page', 'Product line Twitter account', etc. This will help you quickly identify the purpose of these links when managing them in the future.
    • Repeat this step until you have added all the necessary social media links.
  4. Save ChangesAfter completing all social link entries and custom additions, make sure to click the 'Save' button at the bottom of the page to ensure your settings take effect.

Through such centralized management, you can easily update, add, or delete any social media link without touching the frontend code, greatly enhancing the efficiency of website operation.

The second step: Display social links on the website front end

The background configuration is complete, the next step is to let these carefully prepared social links shine on your website.AnQiCMS uses an intuitive template tag system, allowing you to easily call this information in your website template.

  1. UnderstandingcontactTagProvided by AnQiCMS:contactThe label is used to obtain the configuration information of the "Contact Information Settings" configured in the front-end template. Its basic syntax is{% contact with name="字段名称" %}Here is the field name that you entered in the background "Contact Information Settings" (such asFacebook) or a custom "parameter name" (such asFacebookPageLink)

  2. Link called in the templateYou can insert in any HTML template file of the website (such asbash.html/footer.html/contact/index.htmletc)contactLabel to display social links. For example, if you want to display Facebook and Twitter links in the footer, you can write the code like this:

    <div class="social-links">
        {# 调用内置的 Facebook 链接 #}
        {% set facebookLink = contact with name='Facebook' %}
        {% if facebookLink %}
        <a href="{{ facebookLink }}" target="_blank" rel="noopener noreferrer">
            <i class="fab fa-facebook-f"></i> {# 这里通常会配合 Font Awesome 等图标库使用 #}
            <span>Facebook</span>
        </a>
        {% endif %}
    
    
        {# 调用内置的 Twitter 链接 #}
        {% set twitterLink = contact with name='Twitter' %}
        {% if twitterLink %}
        <a href="{{ twitterLink }}" target="_blank" rel="noopener noreferrer">
            <i class="fab fa-twitter"></i>
            <span>Twitter</span>
        </a>
        {% endif %}
    
    
        {# 调用自定义的 LinkedIn 链接 (假设后台参数名为 'LinkedInPage') #}
        {% set linkedinLink = contact with name='LinkedInPage' %}
        {% if linkedinLink %}
        <a href="{{ linkedinLink }}" target="_blank" rel="noopener noreferrer">
            <i class="fab fa-linkedin-in"></i>
            <span>LinkedIn</span>
        </a>
        {% endif %}
    </div>
    

    In the code above, we first use{% set variable = contact with name='FieldName' %}The way to assign the obtained link to a variable.The benefit of doing this is that you can first check if the variable exists (i.e., whether the user has configured the link in the background), and only render the corresponding HTML when it exists to avoid empty links or errors.target="_blank" rel="noopener noreferrer"is the standard practice to ensure that the link opens in a new tab and enhances security.

  3. Adapt your template styleAccording to your website design, you can place these links in the header, footer, sidebar, contact us page, or any place you think is appropriate.They are usually combined with exquisite social media icons (such as the Font Awesome icon library) to provide more intuitive and attractive visual effects.

Practical tips and optimization

  • Standard naming conventionsWhen customizing parameter settings in the background "Custom Settings Parameter", try to maintain the uniformity and readability of parameter names. For example, all social link parameters end with "Link", such asFacebookLink/InstagramLink.
  • Link integrity and security: Always use the full URL and withhttps://starting. In the front-end template, add external links totarget="_blank" rel="noopener noreferrer"Properties, not only can it improve user experience (open links in a new window), but also avoid security vulnerabilities (noopenerPrevent the new window from obtaining the reference of the original window, noreferrerPrevent Referrer information from being sent to the target page).
  • Test and verifyAfter completing the configuration and updating the template, be sure to test these social links on different browsers and devices to ensure they can be clicked normally and jump to the correct social media homepage.
  • Icon beautificationAlthough the code example used<i>The label acts as an icon placeholder, but in actual application, you can integrate Font Awesome, SVG sprites, or custom icon fonts to make your social links more visually appealing.

By following these steps, you can efficiently and flexibly configure and display your social media contact links on the AnQiCMS-driven website, making your site a powerful bridge connecting users and brands.


Frequently Asked Questions (FAQ)

Q1: Will it slow down the page load if I put a lot of social media links in the 'Contact Information Settings'?

A1:Will not.All configuration information in AnQiCMS's 'Contact Information Settings' is processed and stored on the server side, and it will not directly slow down the loading speed of the front-end page.