Connecting to my own CMS (API)?

Hi there,

I am new to webflow and perhaps my question has already been posted, but I have not been able to find it.

Question:
Is it possible to build a site in Webflow that gets its content from my own CMS by an API (Json or XML)?

Love to hear from you!

Greetz, Erwin

Not sure if it fits your use case but have a look here:
https://developers.webflow.com/

Any HTML page using a JS API and a combination of {fields} and custom attributes can be populated by an external CMS. That’s also true for a Webflow page. I once had a website that was designed in Webflow and populated by a Drupal database.

There seems to be a CORS authentication issue trying to pull CMS content from my websites’ CMS into my websites’ pages. How can I GET CMS items without exposing the API end-point for PUT or other editing requests?

You’ll have to fix this on your external service/server. Any additional info on your external service/server?

Thank you for your response Sam @samliew . I’m trying to route the Webflow API through a Webtask mini-server to create an API to only GET info from my Webflow CMS and not edit it, i.e. so I can use Webflow CMS json objects in my client-side code without exposing my api key. My javascript ability is poor, although can you provide any ideas? Is this possible?

You want to use your Webflow project as a database for external use? That is certainly possible with the API provided.

Unfortunately I’m not an “expert” so I can’t really help you there. Should you need assistance with creating an application using the Webflow API, Webflow recommends contacting one of our experts listed here https://experts.webflow.com

1 Like

@samliew Thank you Sam, I want to use Webflow CMS as a database for content on my Webflow site. E.g. Webflow CMS → Webflow API → Webtask Server (just for hiding the API key) → Webflow Site (GET requests to receive and display JSON objects from the Webflow CMS). Does that make sense?

Why can’t you simply do Webflow CMS → Webflow Site? There are collection lists you can use to display collection items from the CMS.

1 Like

Because the webflow site slider can’t update its number of slides based on how many items are in a (slides) Webflow CMS collection.

So, this is actually an X/Y problem. You are attempting to solve this issue/limitation by doing it in a complicated manner.

There are already workarounds discussed on this forum on how to solve this CMS slider issue without having to resort to using the API.

Also, I’m guessing you are trying to use an external slider plugin instead of the Webflow slider. You do not need the Webflow API for this.

Thank you, Sam @samliew. How would I dynamically fill an external slider with CMS items? Do you have a resource you’d recommend? I’ve found the options in the forms very limited.

A bonus of using the Webflow API for this is one could also add advanced server-updating functionality like having a CMS collection item expire (auto-delete itself) after a certain date, e.g. for auto hiding meeting announcement slides when said meeting is over.

It mostly depends on what slider plugin you are using. You can just use a collection list to “print” out all the necessary slide info onto your page, then based on the documentation of the slider plugin, initialise the slider with the correct options.

That’s the general workflow, I can’t be specific as we do not have access to your project.

Like I said, you are over-complicating this. All this info (like an expiry date) can already be managed via the webflow CMS and no additional external app is required.

1 Like

@samliew, thanks! Do you have a slider plugin you’d recommend for this case? I’m looking for any example code for an external slider connecting with a “collection list ‘print[ed]’ out”

And that’s cool you can tell the CMS to auto-delete items after a selected date. How would I set that up?

Here are some examples, which can be easily searched on this forum.

https://discourse.webflow.com/search?q=%22cms%20slider%22%20order%3Aviews

See Creating a Dynamic Slider in Webflow - #89 by jbleroux, which uses cycle2 slider plugin. Basically any/most JavaScript slider plugin can work, you just need some JavaScript knowledge to set up, or contact a Webflow Expert.

You already can apply a filter in the collection list with date time fields. Therefore the “expired” ones won’t show.

@samliew Thank you for curating this slider example. I’d seen jbleroux’s solution although didn’t realize he has a designer preview available, thanks! Sorry to have you search for me.

And thanks for the date-filtering on collection list tip! That’s most helpful.

If anyone has any example code for server-side processing the CMS API to a client side Webflow site, I’d still like to learn that for edge-case client needs that may pop-up in the future. Thanks again though, Sam!

Did you ever figure this out (Getting info from the CMS)? I can find info on writing to the CMS via API, but not reading the contents of one.

@MichaelMannucci - It is actually very straight forward and easy to implement.

https://developers.webflow.com/#get-single-item

1 Like

I feel like you’re following me :stuck_out_tongue: haha

Excuse my ignorance, a lot of that looks like greek to me. Would it be possible to list each item in a collection, along with each of its field, in a list or in a table?

Yes, that would be possible.