Hej, I hope this is the right topic for this Custom Code.
The Problem
I’m facing an issue with counting numbers in a cms entry including zappier.
The Idea
There is a number field in a cms item. When a person clicks a specific button in the item on the live page, the button should add 1 to the number in the backend cms item.
I tried it with zappier but it doesn’t work, since zappier can’t find the item, that the button was clicked in.
Is there a way to help zappier find the item in the cms backend of webflow?
Hej, what I wanted to do is adding like counters to CMS Items.
Webflow
First add a number field to your cms items called “Like Num”. That number can be shown on each CMS item by using a collection list in the template. Set it to zero.
Add the collection list to your CMS Item template to show the number on each item. Now add a form to the cms template and delete the text fields. Besides the Button you can add an html embed with the following code:
<input type="hidden" name="Item ID" value="choose from Button +Add field">
<input type="hidden" name="Post Titel" value="choose from Button +Add field">
<input type="hidden" name="Like Num" value="choose from Button +Add field">
In the Code you just choose the vars from your CMS Databank like you see in the “value”.
Zapier
From here on you can work in Zapier.
just add a form submission trigger and do the math (like num + 1) with a number action in Zapier.
Zapier knows by itself. Just try to trigger a Flow in Zapier by Webflow form submission. Than you can chose the form. There is also a training video from the academy about it.
where I put this code
You can add divs, images, forms, html embeds and so on. The Code needs to be placed in a html embed. You can check this video to learn about it.
Make sure to add the html embed into the form besides the button :+1
So I have multiple cms items each with their own collection page. And each has two button that will correspond to change different values would this work for that too?
Ok cool. Yeah, start with one button. You can add the second later.
So now you have 2 vote count numbers. In your CMS item template you should add the number field votes-up and number field votes-down. These are exactly the values you need to add.
Can you make it cloneable or accessible? Can only see the front end.
I can’t showcase website I dont have paid plan. What do I do lol
Or just tell me how the code would be with votes up and votes down
Also I just realized that I can’t embed code without paying… guess I can’t do it.
P.s I am really thankful for your help and am sorry to be bothering you