Join the Webstudio community

Updated 2 years ago

Defining Classes at This Stage

At a glance
Is there anywhere to define classes at this stage? Similar to how we can define an ID.
O
A
10 comments
Yess, class name is just a property, you can add it over the custom properties in properties panel.
Question: why did you want to use a class?
I am still considering bringing it to the same section where the id is, even though both are just properties.

Just in case people really need it often.
Got it! Thank you πŸ™‚

Some tools (like CRM's or CRO tools) can be launched via a button with a specific class.

Drift's live chat is a good example of this
Basically creating an element with a class and then using hmtl embed with a script to access that element via class
those tools don't use ids?
I would have assumed they would use id most of the time
do you have some examples how they tell. users to use it?
Most use ID's or #[PARAM] links.

As I've been building out a page today for the video I've also been creating a list of features I'd like to have, nice to have, suggestions and bugs which is where these questions are coming from.

Here's an example of a a tool needing a class trigger: https://devdocs.drift.com/docs/start-a-chat-with-a-link
Plain Text
drift.on('ready', function(api) {
    document.querySelector('.drift-open-chat')
        .addEventListener("click", function(){
          drift.api.startInteraction({ interactionId: xxxxxxx }); /* <-- your playbook's interaction ID here */
        })
      })


This ?

IT doesn't need a class, you can use an id, its just a example:

document.querySelector('#drift-open-chat') would do the same
Add a reply
Sign up and join the conversation on Discord