Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Netlify CMS not saving id and the name of article blog in articleTree.js #64

Open
2 of 3 tasks
kalwalt opened this issue Apr 10, 2019 · 5 comments
Open
2 of 3 tasks
Assignees
Labels
bug Something isn't working code design
Milestone

Comments

@kalwalt
Copy link
Owner

kalwalt commented Apr 10, 2019

This is a problem that happens when you create a blog with the Netlify CMS, For the truth there are more than one issue:

  • blog article can not be saved with extension .it.md or .en.md
  • id name and name of the article blog can not be saved in articleTree.js
  • last id is not displayed in the CMS
    Each of these needs a solution.
@kalwalt kalwalt added bug Something isn't working code design labels Apr 10, 2019
@kalwalt kalwalt self-assigned this Apr 10, 2019
@kalwalt
Copy link
Owner Author

kalwalt commented Apr 10, 2019

The first issue is solved with this commit

@kalwalt
Copy link
Owner Author

kalwalt commented Apr 12, 2019

i solved the second point of the list collecting all the articles id in a json file, with the Netlify Cms it is possible to fill all the ids and name of the articlest and save them in the json. For the last ipoint, i'm still investigating...

@kalwalt
Copy link
Owner Author

kalwalt commented Apr 12, 2019

I will add the third point later in the development, i think that for now it is ok.

@kalwalt kalwalt added this to the v1.0.0 milestone Apr 13, 2019
@kalwalt
Copy link
Owner Author

kalwalt commented May 20, 2019

How can take the last id? and display in the CMS?

@kalwalt
Copy link
Owner Author

kalwalt commented May 20, 2019

This shouldn't be too difficult, but the fact is id are already displayed (not the last id) but you can see all the ids in the CMS. Retrieving the ids from the query is simple.
Assumed that this is the query to retrieve the json data:

allArticlesJson(filter:{title:{eq:"home"}}){
   edges{
     node{
       articles {
         en
         it
       }
     }
   }
 }

we get the articles in this way:

const jsonData = data.allArticlesJson.edges[0].node.articles;

and so the last id:

var lenghtJsonData = jsonData.length;
var last_Id = jsonData[lenghtJsonData];
console.log(last_id);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working code design
Projects
None yet
Development

No branches or pull requests

1 participant