thinkphp Project How to customize WeChat share description content

Source: Internet
Author: User
This article mainly describes: in the thinkphp framework, how to get the Sharing interface permissions, how to set up a secure domain name, how to modify the share title, modify share description, modify share pictures, how to customize share content

This article mainly describes: in the thinkphp framework, how to get the Sharing interface permissions, how to set up a secure domain name, how to modify the share title, modify share description, modify the sharing of images, how to customize the sharing content.

Here's a comparison of the effects of modifying the share title, sharing the description, sharing the image, and not modifying it:

No modified share: The URL path where the shared content is a shared page.

Change the effect of sharing content such as: share content for your own custom content.

1, the necessary conditions: Certified public number.

2, in the Public management background, click on the public number settings, enter the function settings, select the JS interface security domain name, download the TXT format certification file in the root directory of the site, and then return to the Public Admin page, determine the authentication, fill in the domain name of the site sharing, save.

3, download the JSSDK interface file package. Download Address: Link: http://pan.baidu.com/s/1eStCSXc Password: 1p8k

4. Configure the JSSDK interface package to the thinkphp extension directory, which is configured in the thinkphp/extend/vendor/directory.

5. Obtain the public number AppID and Appsecret from the public number, and configure it in the thinkphp configuration file.

6. Define the initialization function in the thinkphp common.php file: (The parameters in the case should be taken from the configuration file)

7, in the need to use the custom sharing content of the class file, define the sharing content, and then passed to the template page:

Where: is the custom title, brief is a custom share description content, picture is a custom share image path, is the custom share content is clicked to point to the link address.

8, then the introduction of JS files in the page and the use of configuration parameters:

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.