li-cms-vue
In this tutorial, we will see how to use Cockpit CMS to set up a CMS backend and to use the API interface provided by Cockpit to build a customized functional frontend.
在本教程中,我们将看到如何使用Cockpit CMS设置CMS后端以及如何使用Cockpit提供的API接口来构建自定义的功能前端。
Not quite like other “heavy weight”, or “fully fledged” CMSes, Cockpit is lightweight and “bare”. It only provides a backend to manage meta-data and data entries, whilst the frontend is all in the developer’s hands.
与其他“重量级”或“完全成熟”的CMS不同,Cockpit重量轻且“裸”。 它仅提供一个后端来管理元数据和数据条目,而前端全在开发人员手中。
安装 (Installation)
A copy of Cockpit CMS can be downloaded here in zip form. After downloading, just unzip the archive to a directory on your web server that is accessible. In my case, it is mapped to: http://vagrant/cockpit
.
可以在此处以zip格式下载Cockpit CMS的副本。 下载后,只需将归档文件解压缩到Web服务器上可访问的目录即可。 就我而言,它映射到: http://vagrant/cockpit
。
Next, visit the installation page: http://vagrant/cockpit/install
to start the installation process.
接下来,访问安装页面: http://vagrant/cockpit/install
开始安装过程。
NOTE: Cockpit uses SQLite as its database engine by default. If you have not installed SQLite yet, please do so before the installation.
注意:默认情况下,Cockpit使用SQLite作为其数据库引擎。 如果尚未安装SQLite,请在安装前进行。
NOTE: Cockpit also requires that its /storage/data
directory be writable. Please change the mode of that directory accordingly.
注意:座舱也要求其/storage/data
目录可写。 请相应地更改该目录的模式。
The installation is just one click. When the installation is complete, you will be greeted with this page:
一键安装。 安装完成后,将看到以下页面:
![title alt](https://i-blog.csdnimg.cn/blog_migrate/d196c2e550188b75b876c23d04375c57.webp?x-image-process=image/format,png)
Now we can log in with admin/admin
and the backend administration dashboard page will be shown:
现在我们可以使用admin/admin
登录,将显示后端管理仪表板页面:
![title alt](https://i-blog.csdnimg.cn/blog_migrate/dabbcfa518bd66c6d98456eb38f97301.webp?x-image-process=image/format,png)
Well, we don’t have anything set up yet. Before we create our own content, let’s learn about a few key modules in Cockpit.
好吧,我们还没有任何设置。 在创建自己的内容之前,让我们了解Cockpit中的一些关键模块。
驾驶舱中的模块 (Modules in Cockpit)
The two most important modules in Cockpit are: Collections and Galleries.
驾驶舱中两个最重要的模块是:收藏和画廊。
We can treat “Collections” as a bunch of tables. All collections are defined in Cockpit with various fields of virtually all kinds of types. Collections are populated with “Entries“, which is similar to a record in a table.
我们可以将“集合”视为一堆表格。 所有集合都在Cockpit中定义,几乎包含各种类型的各个字段。 集合中填充了“ Entries ”,这类似于表中的记录。
Galleries are “photo albums”. A user creates a photo album which can contain pictures that can be used later, in the backend as well.
画廊是“相册”。 用户在后端创建相册,其中可以包含以后可以使用的图片。
Cockpit also has other modules: forms, regions (a kind of reusable snippets to be inserted in the frontend pages), media manager (to manage all the media files in the site). The detailed documentation for these modules (include collections and galleries) can be found on the official site.
Cockpit还具有其他模块:表单,区域(要在前端页面中插入的一种可重用代码段),媒体管理器(用于管理站点中的所有媒体文件)。 这些模块的详细文档 (包括收藏和画廊)可以在官方网站上找到。