Comments (13)
I made a reproduction repository but the thing is, that it's working perfectly on this new one. I don't know if could it be an netlify cache issue, I recently face many of those when I uploaded some changes that affected the CMS. Will make some test to make it work. Thanks
https://dreamy-knuth-40c8d6.netlify.com/admin/
https://github.com/tomrndom/netlify-cms-relation-widget
from netlify-cms-widgets.
Ahh so that's what it is. The good news is the folks over netlifyCMS has just merged the fix for this.
Once they release a new update, I will release a patch as well. Thank you for using this library + sharing your debug process, I really appreciate it.
If you'd like, you can subscribe to #25 to get update on the (very soon) patch!
from netlify-cms-widgets.
Thanks for opening an issue @tomrndom, I will check it out
from netlify-cms-widgets.
@tomrndom In config.yml
, The file
field should be the name
of the file, instead of the file location:
files:
- file: "src/content/authors.json"
label: "Authors"
name: "authors" # <-- use this field
...
- label: "Author"
name: "author"
widget: ncw-file-relation
collection: configurations
- file: "src/content/authors.json"
+ file: authors
target_field: authors, id_field: id
display_fields: name
Let me know if that works! I should really make the document better, sorry about that.
from netlify-cms-widgets.
@d4rekanguok Thanks for you response, I'm currently trying changing the file path to the name of the file, but I'm getting this error :
Seems like the loadData function isn't fetching the json file from the src/content/ folder. Insteed of the file, I'm getting an 404 html response.
from netlify-cms-widgets.
Ah something's definitely off, it shouldn't fetch a local file i.e /admin/src/content/authors.json
, it should fetch it from github instead. I'll try to reproduce this with the bit of info you have given, but it'd be awesome if you could put together a reproduction repo 🙏 Thanks @tomrndom!
from netlify-cms-widgets.
Could it be that my repo it's private, and netlify-cms cannot fetch the file from a private repository?
It seems like that's the only difference between the reproduction repo and the one I was trying to implement the widget.
I'm noticing on the network tab that, on the reproduction repo, the site fetch the file, and not in the others repositories
from netlify-cms-widgets.
@tomrndom I have deployed this widget on a few private repos, so I don't think that's the issue...
However I've just found an issue with latest version of netlify-cms-app. Could you try again, but pin your netlify-cms-app version to exactly 2.9.7?
from netlify-cms-widgets.
Oh I've just seen the edit -- I doubt that this is the cause then. :( Perhaps something to do with your backend setup in config.yml?
from netlify-cms-widgets.
It's weird, on both sites the config it's the same
backend:
name: git-gateway
branch: master
from netlify-cms-widgets.
I've just seen this:
const loadData = async (dataPath) => {
const data = await fetch(dataPath)
.then(data => data.json())
.catch(err => console.error(err))
window.repoFiles = data
}
loadData('src/content/authors.json');
I'm so sorry I missed this the first time. If this is the way you want to load data then yes, authors.json
must be in the static
directory, and you'd need to change the path to
loadData('/authors.json')
We are doing this in this repo's packages/playground
, but it's only because we don't want to set up a backend for the demo project 😅 if you're using git-gateway
, you shouldn't use repoFiles
(it's for test-repo
only)
from netlify-cms-widgets.
Yes I noted that, and removed that function from the cms.js file. I'm still working on it to find out a solution.
from netlify-cms-widgets.
Welp it seems it was a problem with the version of netlify-cms-app, it's working with the 2.9.7 version but not with the 2.11.29.
from netlify-cms-widgets.
Related Issues (20)
- Inline widget HOT 14
- Re-order widget – i18n ? HOT 1
- Adding widget script hides existing relations in CMS HOT 2
- Duplicating an item doesn't generate new ID HOT 4
- @ncwidgets/file-relation not working on self assignment HOT 2
- Using `Publish and create new` doesn't create a new ID HOT 9
- Need test + CI
- File Location Widget is broken HOT 2
- (file-relation) Support simple list (string only) HOT 1
- Last updated widget
- [netlify-cms] Add ncw-reorder HOT 2
- unselect an item from a parent optional field HOT 3
- hidden option for ncw-id widget HOT 3
- Display_fields accept one field only HOT 10
- file-relation update
- Form builder widget
- Is it possible to use id widget as js deliver sript?
- Data table widget
- S3 media library
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from netlify-cms-widgets.