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

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解决什么问题

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/394313.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

InfluxDB的HTTP API写入操作

一、说明 为了方便,本文主要使用curl来发起http请求,示例当中也是使用curl这个工具来模拟HTTP 请求。 在实际使用中,可以将请求写入代码中,通过其他编程语言来模拟HTTP请求。 二、InfluxDB通过HTTP API操作数据库 1)建…

揭开勒索软件的真面目

一、前言 2013年9月,戴尔公司的SecureWorks威胁应对部门(CTU)发现了一种名为“CryptoLocker”的勒索软件,它以邮件附件形式分发,感染计算机并加密近百种格式文件(包括电子表格、数据库、图片等)…

leetcode486. 预测赢家(动态规划)

给定一个表示分数的非负整数数组。 玩家1从数组任意一端拿取一个分数,随后玩家2继续从剩余数组任意一端拿取分数,然后玩家1拿,……。每次一个玩家只能拿取一个分数,分数被拿取之后不再可取。直到没有剩余分数可取时游戏结束。最终…

w550官方例程_急!求索爱w550的刷机所需要的所有文件! 全部分送上!

展开全部W550c行货软件升级使用国内行货W550c手机的朋友,将来是可以在62616964757a686964616fe58685e5aeb931333238646330官方网站使用随机数据线免费升级的,目前W550c的最新版本是R4AB048但是由于目前官方网站还未提供,大家敬请期待。W550c索…

python的xpath用法介绍_python爬虫之xpath的基本使用详解

本篇文章主要介绍了python爬虫之xpath的基本使用详解,现在分享给大家,也给大家做个参考。一起过来看看吧一、简介XPath 是一门在 XML 文档中查找信息的语言。XPath 可用来在 XML 文档中对元素和属性进行遍历。XPath 是 W3C XSLT 标准的主要元素&#xff…

杨波 微服务技术专家_专家称,这些是最有效的微服务测试策略

杨波 微服务技术专家by Jake Lumetta杰克卢米塔(Jake Lumetta) 专家称,这些是最有效的微服务测试策略 (These are the most effective microservice testing strategies, according to the experts) Testing microservices is hard. More specifically, end-to-end…

LRU算法实现

LRU是Last Recent Used 缩写,做为一种缓存算法,将最近较少使用的缓存失效。memcache采用了该算法。如下采用了一种PHP的实现方式。该算法将每次新增的内容,放到缓存顶部,达到缓存极限时,将缓存底部的内容清除。可以通过…

Java中的阻塞队列-LinkedBlockingQueue(二)

原文地址:http://benjaminwhx.com/2018/05/11/%E3%80%90%E7%BB%86%E8%B0%88Java%E5%B9%B6%E5%8F%91%E3%80%91%E8%B0%88%E8%B0%88LinkedBlockingQueue/ 在集合框架里,想必大家都用过ArrayList和LinkedList,也经常在面试中问到他们之间的区别。…

自动加密企业关键业务数据 赛门铁克推出全新信息保护解决方案

最新推出的Symantec Information Centric Security解决方案,能够帮助企业随时随地对数据进行自动加密、跟踪和撤销,提供卓越的可见性和管控力 近日,全球网络安全领域的领导者赛门铁克公司宣布推出一款全新的高级信息保护工具 Symantec Inform…

leetcode312. 戳气球(动态规划)

有 n 个气球,编号为0 到 n-1,每个气球上都标有一个数字,这些数字存在数组 nums 中。 现在要求你戳破所有的气球。如果你戳破气球 i ,就可以获得 nums[left] * nums[i] * nums[right] 个硬币。 这里的 left 和 right 代表和 i 相邻…

碳钢腐蚀速率计算公式_镁合金轮毂螺栓连接的电偶腐蚀行为

环境污染和能源短缺促使日益发达的汽车工业大力推进构件轻量化,镁合金是最轻的结构材料之一,构件采用镁合金制造可以在减重的同时不降低结构强度,受到汽车工业的青睐。轮毂作为汽车的主要组成部件,其轻量化是汽车节能减排的有效途…

第七周总结

2019第七周作业 本周作业头 这个作业属于那个课程C语言程序设计II这个作业要求在哪里https://edu.cnblogs.com/campus/zswxy/computer-scienceclass1-2018/homework/2939我在这个课程的目标是理解指针数组和地址之前的关系及应用这个作业在那个具体方面帮助我实现目标practice参…

python大纲图_Python课程大纲

课程大纲被分成6个部分,每个部分又被分解为多个阶段, 而每个阶段包含了多个Try, Workshop, FactToFace, Apply. 这里只列出部分,和阶段:CHAPTER 0 : 预科[可选]Linux使用,常用CMD,服务配置,IDE&…

如何使用Google Authenticator在ASP.NET Core中设置两因素身份验证

介绍 (Introduction) In this article, we are going to learn how to perform two-factor authentication in an ASP.NET Core application using the Google Authenticator app.在本文中,我们将学习如何使用Google Authenticator应用程序在ASP.NET Core应用程序中…

280. Wiggle Sort

最后更新 二刷 这个题做得真蠢。上来想的复杂了,想的是quick sort之类的,然后一个一个交换。 实际上直接交换就行。。没啥特别的。 回头看一刷也是同样的思考过程 宿命论啊。。 Time: O(n) Space: O(1) public class Solution {public void wiggleSort(i…

避免人为灾难:盘点数据中心里十大愚蠢行为

对于企业运营,数据中心从设计、部署等各个环节都有极其严格的规范,保证简单的“题目”不出错也需要企业IT管理人员的智慧,在数据中心任何一个小错误往往会带来巨大灾难。数据中心从设计、部署、测试、运行、运维等各个环节都不能有任何的疏忽…

python中node.tag的用法_python在ui自动化中的一些常见用法

http://cn.python-requests.org/zh_CN/latest 可以查看requests库的说明,pprint(res.json(),width30)可以对请求的返回值按照json格式化形式进行打印。常见的content-type 有application/x-www-form-urlencoded、application/json、application/xml。自动化测试操作…

leetcode1039. 多边形三角剖分的最低得分(动态规划)

给定 N,想象一个凸 N 边多边形,其顶点按顺时针顺序依次标记为 A[0], A[i], …, A[N-1]。 假设您将多边形剖分为 N-2 个三角形。对于每个三角形,该三角形的值是顶点标记的乘积,三角剖分的分数是进行三角剖分后所有 N-2 个三角形的…

TRIZ解决问题方法

个人觉的成功是有规律的,那些成功的人士,都有一套处理事情的秘籍。只要我们的思维方式把那些秘籍融会贯通,并快速执行,我们有一天也会成功的。 TRIZ解决问题的5点方法。 1.确定最终目标。 2.列出阻碍因素 3.消除阻碍因素 4.可以利…

windows调用python_windows 快捷调用Python语言

本文主要向大家介绍了windows 快捷调用Python语言,通过具体的内容向大家展示,希望对大家学习Python语言有所帮助。场景1:某云平台的账号/或密码比较长,一旦浏览器缓存失效,就要去邮件/文件查找,费时费力场景…