restful解决什么问题

by Jessica Duffin Wolfe

杰西卡·达芬·沃尔夫(Jessica Duffin Wolfe)

当您陷入RESTful,WordPress和一个困难的地方时,如何解决CMS问题 (How to solve a CMS problem when you’re caught between RESTful, WordPress, and a hard place)

Last fall I was trying to decide on how to host and manage a small storytelling project built by around 40 users — my students. I wanted them to have a clean and easy experience uploading their content (images and audio files, along with some text). I also wanted it to be stored long-term in a format my little Vue.js app could easily pull in to display without a lot of set up and overhead on my part.

去年秋天,我试图决定如何托管和管理一个由大约40个用户(我的学生)构建的小型故事项目 。 我希望他们在上载内容(图像和音频文件以及一些文本)时拥有干净整洁的体验。 我还希望将其以我的小Vue.js应用程序可以轻松插入显示的格式长期存储,而无需进行很多设置和开销。

I’ve relied very happily on WordPress as a primary Content Management System (CMS) for years, but it’s been feeling a bit old lately, and it’s not quite designed for such a heavily AV-based, multi-user project, so I decided to look around for good fresh options.

多年来,我一直非常愉快地将WordPress用作主要的内容管理系统(CMS),但是最近感觉有点陈旧,并且它并不是为基于AV的多用户项目而设计的,因此我决定到处寻找新鲜的好选择。

选项1:Google表格 (Option 1: Google Sheets)

The simplest path seemed to be setting up a Google Sheet the students could populate with links to their own self-hosted media. I’ve had good experiences building small sites like this before pulling in the data through JSON.

最简单的方法似乎是设置一个Google表格,学生可以在其中添加指向自己的自托管媒体的链接。 在通过JSON提取数据之前,我在构建像这样的小型网站方面有很好的经验。

For this case, though, with around fifteen different content pieces going into each user’s contribution, if I used a spreadsheet it would be a beast, and populating it would not be a good user experience for the students.

但是,对于这种情况,每个用户的贡献中有大约15个不同的内容,如果我使用电子表格,那将是野兽,而填充它对于学生而言将不是良好的用户体验。

The links to the students’ self-hosted media also risked going bad over time, as accounts lapse, and services dry up. I didn’t want the project to get patchy, and I didn’t want to have to do too much maintenance on it each year to keep it solid.

随着时间的流逝,由于帐户失效和服务枯竭,与学生的自托管媒体的链接也可能会变坏。 我不希望该项目变得零散,也不想每年对其进行过多维护以保持其坚固性。

So, no to Google Sheets.

因此,对Google表格不适用。

选项2:内容充实 (Option 2: Contentful)

Contentful is a headless CMS, which means it provides infrastructure for storing, editing, and serving content without providing any sort of front-end display. Traditional WordPress, in contrast, is set up to do both — store your content, and offer up all the code that retrieves and displays it. This big stack of abilities makes it pretty bulky, and increasingly it doesn’t feel as nimble as a web tool should.

Contentful是无头CMS,这意味着它提供了用于存储,编辑和提供内容的基础结构,而无需提供任何类型的前端显示。 相比之下,传统的WordPress可以同时执行这两种操作-存储您的内容,并提供检索和显示它的所有代码。 如此众多的功能使其变得非常庞大,并且越来越感觉不到Web工具应该具有的敏捷性。

I was really excited about Contentful. It’s so pretty and slick! And so smart — it permits direct geotagging of content! Ahhh. And I could set up a custom content model that exactly matched the project at hand, and it was fun! Yay.

我对Contentful感到非常兴奋。 它是如此的漂亮和光滑! 如此智能-它允许直接对内容进行地理标记! 啊 而且我可以建立一个与手头项目完全匹配的自定义内容模型,这很有趣! 好极了。

After spending some time configuring Contentful, I desperately wanted to use it, but I began to lose interest the more I thought through how the students would upload their work.

在花了一些时间配置Contentful之后,我非常想使用它,但是我对学生如何上传他们的作品的想法越多,我就开始失去兴趣。

The free tier maxes out at five users. While I could have had the students upload their content through one generic user account, this would not have been a good experience, as they would have had to wade through the back end and other people’s files to submit their work.

免费套餐最多可容纳五个用户。 尽管我本可以让学生通过一个通用用户帐户上传内容,但这并不是一个很好的体验,因为他们必须经过后端和其他人的文件才能提交工作。

I also wasn’t convinced that the free tier would have covered the hosting needs of this project. It probably would have been fine — but I would have found myself keeping an eye on bandwidth and API requests and the longterm status of the content.

我也不相信免费套餐能够满足该项目的托管需求。 可能会很好-但我会发现自己一直在关注带宽和API请求以及内容的长期状态。

With the first paid tier starting at $249 per month, levelling up was too expensive to consider. That pricing deterred me from even wanting to use a free account, because I knew I would never upgrade at that price. So there was a chance I’d need to migrate everything if I started building the project on the service.

由于第一个付费级别的起价为每月249美元,因此升级成本太高,无法考虑。 这种价格使我什至不想使用免费帐户,因为我知道我永远都不会以这个价格升级。 因此,如果我开始在服务上构建项目,就有可能需要迁移所有内容。

It was clear Contentful didn’t really want the business of small-scale experimental work — fair enough — and anyway it was getting too annoying to be fussing over these details for a little project.

很明显,Contentful并不真正希望进行小规模的实验工作(足够公平),无论如何,它变得太烦人了,以至于无法为一个小项目忙于这些细节。

选项3:RESTful WordPress (Option 3: RESTful WordPress)

While I was trying to make Contentful work, I kept switching back to a WordPress install to play around. Bulky though the old WP can be, faced with Contentful’s nickle-and-dime approach of charging for content “records,” I was starting to feel very nostalgic for the ease and freedom of adding content in WordPress.

当我尝试使Contentful正常工作时,我一直切换回WordPress安装进行操作。 尽管可以使用旧的WP,但是由于面对Contentful的内容“记录”收费的灵活方法,我感到非常怀旧,因为我对在WordPress中添加内容的便捷性感到非常怀旧。

I thought — well, hey — why not use WordPress as a headless CMS with its new REST API feature? This would let me get around the bulk of serving content through PHP, while still allowing me to use WordPress as a CMS, an interface my students know well.

我以为-嘿-为什么不将WordPress与其新的REST API功能一起用作无头CMS? 这将使我能够通过PHP解决大量的内容提供服务,同时仍然允许我将WordPress用作CMS,这是我的学生很熟悉的界面。

To allow the students to add all the images and audio for their projects, I would need to add a custom post type. To do that I would need to add a plugin. To use the plugin I would need to figure out how to configure it, and then create an appropriate custom post type that would provide in an easy-to-use interface inside the WP system. To do that I would need to rewrite WordPress from the ground up, because bless its heart it is not built to do anything other than look and feel like WordPress. It manages blog posts really, really, really well, and can be muddled into doing some other things sort of but not well. The whiff of the blog post never really fades.

为了允许学生为他们的项目添加所有图像和音频,我需要添加一个自定义帖子类型。 为此,我需要添加一个插件。 要使用该插件,我需要弄清楚如何配置它,然后创建一个适当的自定义帖子类型,该类型将在WP系统内部的易于使用的界面中提供。 为此,我需要从头开始重写WordPress,因为请保佑它的内心,它的外观和感觉不像WordPress。 它确实,非常,非常好地管理博客帖子,并且可能被混淆为做一些其他事情,但是做得不好。 博客帖子的味道从未真正消失过。

I gave up on all this before even trying to figure out how I would use the REST API in my project. I’m still excited about it, though. It’s probably an amazing option for serving content from larger sites using JS frameworks.

我什至在试图弄清楚如何在项目中使用REST API之前就放弃了所有这些。 不过,我仍然对此感到兴奋。 对于使用JS框架从较大的站点提供内容,这可能是一个了不起的选择。

选项4:WordPress +表格= CMS Sugar (Option 4: WordPress + Forms = CMS Sugar)

The solution I finally settled on seemed ridiculously simple and a funny amalgam of all my earlier efforts.

我最终选择的解决方案似乎很简单,而且是我以前所有工作的有趣组合。

Using Gravity Forms, a WordPress plugin I know my way around from other projects, I built a basic form through which the students could upload all fifteen of their files, and paste in their text components.

使用Gravity Forms(一个我在其他项目中知道的方法)的WordPress插件,我建立了一个基本表单,学生可以通过该表单上载全部15个文件,并粘贴其文本组件。

I exported the entries as a spreadsheet with links to the uploaded content stored in the WordPress site, and I turned this file into JSON to use just as I would a Google Sheet.

我将条目导出为电子表格,并带有指向WordPress站点中存储的上载内容的链接,然后将该文件转换为JSON以像使用Google表格一样使用。

So my students got a clean, familiar, and accessible experience uploading their content, and I will be able to store it long term without hassle in a format my static web app will play nicely with. Problem solved.

因此,我的学生在上载内容时获得了干净,熟悉且可访问的体验,并且我将能够长期存储它,而不会遇到麻烦,可以使用我的静态Web应用程序可以很好地使用的格式。 问题解决了。

Ta da! Why was this solution not more obvious when I began?

da! 为什么当我开始时这种解决方案不那么明显?

For me, one moral of this story is that even in this era of increasingly fancy decoupled and well-rested deployment options, it still helps to know your way around WordPress — that despite getting a bit long in the tooth, its low-cost, and feature-rich ecosystem continues to lower barriers to digital creativity.

对我来说,这个故事的寓意是,即使在这个如今越来越花哨的去耦合和休息的部署选项的时代,它仍然有助于您了解WordPress的使用方法-尽管花费了很多时间,但它的低成本,而且功能丰富的生态系统继续降低了数字创意的障碍。

翻译自: https://www.freecodecamp.org/news/how-to-solve-a-cms-problem-when-youre-caught-between-restful-wordpress-and-a-hard-place-77bbebe49e1b/

restful解决什么问题

restful解决什么问题_当您陷入RESTful,WordPress和一个困难的地方时,如何解决CMS问题...相关推荐

  1. redis rua解决库存问题_【150期】面试官:Redis的各项功能解决了哪些问题?

    点击上方"Java面试题精选",关注公众号 面试刷图,查缺补漏 >>号外:往期面试题,10篇为一个单位归置到本公众号菜单栏->面试题,有需要的欢迎翻阅 阶段汇总集 ...

  2. vscode vue解决跨域_在vs code 中如何创建一个自己的 Vue 模板代码

    首先,在vs code 中打开定义模板代码的地方 第一步,点击"设置"图标按钮,在弹出的菜单中点击的"用户代码片段"(也就是模板) 第二步,在弹出的框中选择新建 ...

  3. 梦幻西游三维版显示服务器未开启,梦幻西游三维版登录不进去怎么办-梦幻西游三维版登录不进去解决办法介绍_斗蟹游戏网...

    [斗蟹攻略]梦幻西游三维版登录不进去怎么办?有很多小伙伴们都不知道,那么下面就由斗蟹小编为大家带来梦幻西游三维版登录不进去解决办法介绍,希望能够帮助到大家. 梦幻西游三维版登录不进去解决办法介绍 提示 ...

  4. dev调试时无法进入下一步_【问题解决方案】Dev C++ 无法调试的问题与解决

    浅谈ARP协议以及应用 0. 前言 本章主要简单的介绍ARP的协议格式,主机如何发送和处理ARP报文,以及免费ARP. 1. ARP协议原理 ARP,全称Address Resolution Prot ...

  5. winform中listview选中整行_工作中常见的11个Excel难题,一次解决!

    Hello,各位叨友们好~ 叨叨君每天上班的第一件事就是做Excel数据报表,做多了也就积累了一些实用的Excel技巧,今天整理出来分享给大家,希望对大家的工作有所帮助哦! 01 合并多个单元格内容 ...

  6. JAVA解决实例问题_解决java方法

    没有R.java问题找不到getActionBar()方法 android项目,可是项目中没有重要的R.java,并且报错,说是找不到getActionBar()方法,上网寻找原因,终于寻得解决方法: ...

  7. 用python和sympy库解决方程组问题_使用 Python 解数学方程

    说到数学题,相信大家都不陌生,从小学到大学都跟数学打交道. 其中初中的方程组,高中的二次曲线,大学的微积分最为头疼, 这个项目 就使用python 来解决方程组问题,微积分问题,矩阵化简. SymPy ...

  8. 联想笔记本声音太小怎么办_笔记本声音太小,详细教您笔记本电脑声音太小解决方法...

    网友们在玩电脑游戏时,会遇到声音会很小的情况,如果笔记本游戏声音小的话,会让我们在使用笔记本时不自在,然而,笔记本声音小是低端笔记本的一个通病.那么该怎么去解决呢?下面,小编就来跟大家介绍笔记本电脑声 ...

  9. JSP设置Excel表格换行_工作中常见的11个Excel难题,一次解决!

    Hello,各位叨友们好~ 假期最后一天,明天就要上班了,叨叨君每天上班的第一件事就是做Excel数据报表,做多了也就积累了一些实用的Excel技巧,今天整理出来分享给大家,希望对大家的工作有所帮助哦 ...

最新文章

  1. python文本处理实例_Python 文件处理的简单示例
  2. POJ1324贪吃蛇(状态压缩广搜)
  3. nginx 和 uWISG 服务器之间如何配合工作的
  4. The authenticity of host '0.0.0.0 (0.0.0.0)' can't be established.
  5. P1063-能量项链【区间dp】
  6. 跨越原理优缺点_请教:单管跨越式和双管式的优缺点
  7. 【layui】【laydate】设置可以选择相同的年份范围
  8. eruda手机端调试神器
  9. 第五章:逻辑回归(Logistic 回归)
  10. python元胞转list_python元胞自动机的简单实现
  11. Jquery EasyUi日期输入框(点击今天不自动填充)
  12. 美团监控系统mysql_美团MySQL数据库巡检系统的设计与应用
  13. 218个数据采集模板免费下载(最新)
  14. vs中程序获取计算机系统音量,用C# 控制Windows系统音量的实现方法
  15. scratch编程植物大战僵尸教程(一)
  16. 解决:WPS for Linux提示“系统缺失字体symbol、wingdings、wingdings 2、wingdings 3、webding”...
  17. SVM之线性不可分与核技巧
  18. 【边做项目边学Android】手机安全卫士10-设置向导之绑定SIM卡
  19. 对Java中常见的四种I/O模型理解
  20. springboot启动原理及其流程

热门文章

  1. MySQL字段拼接Concat
  2. 使用vs自带的性能诊断工具
  3. 这是我们的第一篇博客----偕行软件
  4. 编程算法 - 将排序数组按绝对值大小排序 代码(java)
  5. 成功试验基于C#/.NET的Android开发
  6. 第38天:运算符、字符串对象常用方法
  7. (译) JSON-RPC 2.0 规范(中文版)
  8. linux系统分两种更普遍的包,rpm和tar,这两种安装包如何解压与安装
  9. iOS UI 18 数据库
  10. sunspot 查询语法