locomotivecms / documentation

The website sources about the new LocomotiveCMS documentation "center"
51 stars 120 forks source link

No documentation on how to pull content entries through the api, or in general how to use locomotive as a service #41

Open oveddan opened 11 years ago

oveddan commented 11 years ago

Often a code base can become a mess when you have a cms, e-commerce platform, and other components jumbled into one app. It's more desirable in this case to keep those platforms separate, and consume then as needed through an API in the public facing application. This keeps the main app thin and flexible.

For those of us who want to use locomotive purely for its content editing, organization, and admin capabilities, and keep it separate from our consuming application, there is no documentation on how to pull content entries through a rest API.

I.E., let's say I want to create a list of classes available at a school in Locomotive. What would be the api call to A) get those list of classes and B) get the content for each class?

There should be some better documentation with examples of consuming Locomotive content from the outside.

An easier solution would be, when creating a content entry in the admin, to display it's publicly accessible url. Same could go for for folders of content entries.

did commented 11 years ago

I agree with you. What would be the best tool for you ? A ruby lib to get content entries from an engine thanks to the API or just an example in the documentation ?

jloosfelt commented 11 years ago

I guess we should start with a short REST documentation and if developers ask for, write a specific gem? I think the REST API is mostly useful when connecting a LocomotiveCMS site with another technology.

oveddan commented 11 years ago

Well, it seems like out of the box, the ContentEntries controller supports pulling content as JSON - is this true?

If so - this would be an ideal point for integration. You would be able to call this controller directly from the outside (mobile app, other website, etc).

An example on how to do this in the documentation, or some unit tests, would a good first step - then people (like myself) could create client libraries to consume this content via a GET request.

When you edit/create content entries, a great first step to documentation would be showing on that page the url (permalink) to use to retrieve that content.

oveddan commented 11 years ago

Another good api call to document would on how to get a list of content entries under a parent, and also maybe another api call to get info on the structure of that content (in other cms this is called the content template, not sure what this is called in Locomotive since I'm new to it)

jloosfelt commented 11 years ago

@oveddan It looks like you have dig in the rest API, would you be interested in contributing to the documentation on that topic?

calvincestari commented 10 years ago

@oveddan I'm having difficulties in getting PUT/POST to work via the API; https://github.com/locomotivecms/engine/issues/971. Have you had any luck in getting them to work that could be used as a basis for the documentation?

amalagaura commented 9 years ago

What is really interesting from a business perspective is that content management as a service has picked up. https://gigaom.com/2014/05/13/contentful-says-its-api-based-content-management-means-create-once-display-anywhere/

I briefly used Contentful and I think Locomotive can give it a run for its money. I would love an interface like this to Locomotive. Locomotive's backend is awesome.

https://github.com/contentful-labs/contentful_middleman

It would certainly make it easier to use Locomotive in larger applications where a straight CMS doesn't quite fit.

oveddan commented 9 years ago

@amalagaura Thanks for pointing out Contentful - it's the exact idea I've always thought about, but would be great if there was an open source option. I believe Locomotive can be shaped to have this capability too.

The main concept is:

Advantages:

What do you think @did @jloosfelt ?

toebu commented 7 years ago

Hi, is there any progress on this or plan to make this a reality? Would be awesome to have this!

did commented 7 years ago

hi @toebu, what about this? https://github.com/locomotivecms/coal

toebu commented 7 years ago

Thanks for the fast reply! Looks interesting, but that's a Ruby client. It looks like it's backed by a RESTful web service which is what I'm looking for. Is there documentation for that web service?

startupengine commented 7 years ago

Seconding the request for an example of how to pull a JSON object of a content entry via REST API.