contentful

Accessing your Contentful space failed with gatsby-source-contentful

天涯浪子 提交于 2020-05-29 06:49:07
问题 gatsby: 2.20.8 gatsbh-source-contentful: 2.2.5 I've verified my spaceId and accessToken are correct, and I've verified that these keys have access to my Contentful development environment. I've tried: Enabling GATSBY_CONTENTFUL_OFFLINE Deleting the .cache directory Deleting node_modules Setting environment to "master" and removing it completely Wrapping the env vars in template literals (suggested on an old github issue) I keep getting this error. Any ideas? ERROR Accessing your Contentful

Convert Contentful Model to EnvironmentObject

梦想与她 提交于 2020-05-16 03:55:06
问题 I need to convert my Contentful model to be accessible between multiple views. So, for example, I will have a list of movies & each will have an image, title & a URL to a trailer. I will have a view for handling the images and when a user taps on an image I would like the view for the title to update & the view that will play the trailer to update based on the selection. What would be the best way to update below so that when I call selectableRow I can update my title & my video player with

Filtering by dates in Gatsby and Contentful

倾然丶 夕夏残阳落幕 提交于 2020-01-04 15:10:20
问题 How can you filter by dates in Gatsby? The docs allude to lt and gt operators, I get errors when I try to use them. 回答1: Filtering by date in Gatsby is potentially tricky. Many API's send dates in JSON as strings - in the ISO8601 format. That means that GraphQL will treat the dates as strings too. This is fine if you are happy filtering on string equality, but that's not usually how you want to filter on dates. A common use case is to filter to dates that are in the past or future. In most

Contentful CMS - getting image

旧城冷巷雨未停 提交于 2019-12-25 18:41:20
问题 How can I get each image for each entries. I have two array. items and includes ex: items.fields.name = Mark How can I get the image associated to Mark? 回答1: If you are using the HTTP REST API directly, you'll need to do the mappings yourself. For example, if you have an image in items[0].fields.image, that will contain an object with a sys property, with details about the kind of entity that is linked (asset or entry) and the id. Then you'll need to look for that in the includes array and

Angular & Contentful: Cannot create asset inside a space

假装没事ソ 提交于 2019-12-24 19:47:26
问题 I have an Angular application that uses Contentful (v. 5.1.3). I want to upload an asset to Contentful from the Angular app. According to the official site, the correct way to do it is: client.getSpace('<space_id>') .then((space) => space.createAsset({ ... }) See here: https://www.contentful.com/developers/docs/references/content-management-api/#/reference/assets The problem is that the Space object does not have a createAsset method. In fact, the only methods it has are locales , name , sys

Programmatically create Gatsby pages from Contentful data

廉价感情. 提交于 2019-12-22 04:42:57
问题 I am looking for help with GatsbyJS and Contentful. The docs aren't quite giving me enough info. I am looking to programmatically create pages based on contentful data. In this case, the data type is a retail "Store" with a gatsby page at /retail_store_name The index.js for each store is basically a couple of react components with props passed in e.g. shop name and google place ID. Add data to contentful. Here is my example data model: { "name": "Store" "displayField": "shopName", "fields": [

contentful api markdown conversion to HTML

不打扰是莪最后的温柔 提交于 2019-12-22 03:17:05
问题 Is there any simple way to convert markdown text from contentful api to render into html code to be display on html page. I have tried using pagedown and some similar techniques , but none seem to work for me . 回答1: I'm a customer success manager at Contentful - You can check out a list of recommended parsers by language on the our FAQ. Also, feel free to send us messages on Intercom via our UI by clicking the 'Talk to Us' link :) 回答2: I know I'm late but here's the solution using handlebars:

How to enable flag for GATSBY_CONTENTFUL_OFFLINE=true?

纵然是瞬间 提交于 2019-12-14 02:25:07
问题 How to enable GATSBY_CONTENTFUL_OFFLINE=true in GatsbyJS to access content offline? The documentation suggests to export GATSBY_CONTENTFUL_OFFLINE=true . I have tried adding it in the config but still it doesn't work. Can anyone tell me where to add this export or else if the functionality actually works? 回答1: You would use export … in your .bashrc or similar. You're exporting a variable declaration from the shell script into your shell session, making it available as an environment variable.

Contentful API returning 'version mismatch' on entry update

和自甴很熟 提交于 2019-12-13 07:24:32
问题 I'm attempting to do the following with the Content Management API for Contentful: Get an entry (entry1) Find another entry (entry2) using data from a field in entry1 Update entry1 with data from entry2 My code looks like this: client.getSpace("xxxxxxxx").then(function(space){ space.getEntries({ "content_type": "xxxxxxxx", "sys.id": "2KEZYJOgDSeQMCQIE0Oo88", "limit": 1 }).then(function(places){ //search for relevant category entry space.getEntries({ "content_type": contentType.category, "sys

Contentful: Prevent webhook from triggering, when using Content Management API

混江龙づ霸主 提交于 2019-12-12 17:16:12
问题 So I've created a webhook within the Contentful dashboard, that triggers when an entry is either published or deleted, and it works as it should. However, I want to be able to publish entries via the Content Management JavaScript API, without triggering the webhook. Are there any measures I can take to make this possible? 回答1: Unfortunately there's no difference if an entry is published through the API or the web app directly. The web app simply calls the API under the hood. What might be