Loading…

CMS classification

# Preface This tutorial is based on the "apifm-wxapi" module and teaches you how to quickly implement small program development, so you may need to understand the following knowledge points first: ["Creating HelloWorld Project"](https://www.yuque.com/apifm/doc/hezlrm) ["Use "apifm-wxapi" to quickly develop small programs"](https://www.yuque.com/apifm/doc/mdldsd) ["Register for free to open the backend and obtain an exclusive domain name"](https://www.yuque.com/apifm/doc/qr6l4m) # Function introduction 1. Mainly to meet the scenarios where classified information, CMS article classification, news information categories, etc. need to be classified; 2. Manage unlimited levels of classification in the background, and freely set the affiliations of large and small classifications; 3. The mini program can read all classified data and display it with just one line of code; # Enable the "CMS classification information module" module Log in to the "First Step" registration background, left menu --> Factory settings --> Module management Find the "CMS Classification Information Module" module, click "Enable Module", then F5 to refresh the background interface, you will see the new menu: "CMS module" --> "Classification management"; ![](https://dcdn.it120.cc/yuque/0/2019/png/572726/1572848346670-1b073f73-e502-47a8-8dfc-a681bab13f94.png) # Mini program code: ```plain const WXAPI = require('apifm-wxapi') WXAPI.init('gooking') Page({ data: { }, onLoad: function (options) { }, onShow: function () { }, cmsCategories() { // Read all category data WXAPI.cmsCategories().then(res => { console.log(res) if (res.code == 0) { wx.showToast({ title: 'Read successfully', icon: 'success' }) } else { wx.showToast({ title: res.msg, icon: 'none' }) } }) }, cmsCategoryDetail() { // Read the detailed data of a certain category const cmsCategoryId = 3189 //Record ID in the record WXAPI.cmsCategoryDetail(cmsCategoryId).then(res => { console.log(res) if (res.code == 0) { wx.showToast({ title: 'Read successfully', icon: 'success' }) } else { wx.showToast({ title: res.msg, icon: 'none' }) } }) }, }) ``` > WXAPI.init('gooking') This code links your mini program to your backend, where gooking is your exclusive domain name (please check the chapter about exclusive domain names in the preface); > _You can implement the above functions for free in 5 minutes, it’s so simple~ Hurry up and make a blog applet of your own (start with blog classification)_ _No back-end programming is required, as long as you have a good idea, you can quickly implement it! _ Looking forward to your progress! grateful!