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.pswp.cn/news/394313.shtml
繁體地址,請注明出處:http://hk.pswp.cn/news/394313.shtml
英文地址,請注明出處:http://en.pswp.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:某云平臺的賬號/或密碼比較長,一旦瀏覽器緩存失效,就要去郵件/文件查找,費時費力場景…