Join the Webstudio community

Updated 2 months ago

Paste multiple attributes at once

At a glance
(Not sure if anyone suggested this yet)

One thing I really like about Advanced Input is that its possible to paste multiple CSS properties and its values and Webstudio just "get it", and applies all of it.

I was wondering if it would be possible to do that same kind of flow with custom attributes (like the example below) to the Properties & Attributes panel

data-attribute1="value1"
data-attribute2="value2"
data-attribute3="value3"
data-attribute4="value4"
O
B
v
12 comments
Good idea πŸ’‘
What is exact use case for this? Attributes are more tied to elements in many cases. Would "paste html" work for you here?
one of the use cases i can think of
Attachment
Capturar.JPG
So setting up all attributes at once
I assume you would want to be able to copy them all at once too, no?
Actually I am not quite sure what's your workflow. Do you want to copy them from an existing ws instance?
I was thinking that when an element has multiple attributes and values, I could write them in a pre-determined format and paste them into one single field. Webstudio would then recognize it and create the equivalent. The goal would be not to create them one by one

I just gave swiper as the example because it was the first thing that came to mind and also is a popular use case
why not define them on an instance once and then copy instance?
sure, you can do that.

my idea is mostly for the initial setup, but it can also be useful for updating an attribute (or many of them all at once. [ex: changing their names without deleting and adding them again manually]). Or even reordering them for organizational purposes

Since the Advanced input does something similar for CSS, just thought of throwing this idea out
Did you have a real world situation like that? I am genially curious if you did
in particular a situation where just copying the instance wouldn't help
of course

This idea came to mind mostly because I have a project (https://siftcms.site/docs) that is very heavy in attribute use. So for initial setup, updating, and organizing would be more time-efficient

You're right that in most cases setting up one instance will be more than enough. However, having more flexibility in how to customize attributes would be cool to have.

Doesn't even have to be the way I originally proposed, but something like having the UI of updating the name of an attribute without having to delete them, or reorganize in preferred order would be nice
Add a reply
Sign up and join the conversation on Discord