webflow-ruby icon indicating copy to clipboard operation
webflow-ruby copied to clipboard

Delete: Allow passing `live` parameter

Open vfonic opened this issue 2 years ago • 0 comments

I've been constantly having issues with Webflow CMS items not being properly synced. I realized that removing the items is the most problematic.

I ended up publishing for every "delete". I finally found a "cheaper" way to achieve this. If we delete without live: true, the item will stay visible on the site until the site is published again. If we delete with live: true, the item will be set as draft and not visible on the site, but it will be visible in the Webflow CMS. We can call delete with live: true to remove it from the site (and make it a draft) and then call delete again, without live: true to remove the item from Webflow completely:

client.delete_item({ '_cid' => collection['_id'], '_id' => webflow_item_id }, live: true)
client.delete_item({ '_cid' => collection['_id'], '_id' => webflow_item_id })

To allow this functionality, I need the support for live: keyword argument to delete_item method.

vfonic avatar May 23 '23 19:05 vfonic