Class name change when copying block

So, when I do copy a block, random class names will be applied when inserting the block.
I do name my classes because it is so much more efficient when reading the code, beside that it’s just cleaner.
It’s useful to name them but as soon as I want to use the block again on another page or site, it’s becoming totally useless.

How can I keep my classes?
I know it was possible at some time and I also know things have changed.
There were some thoughts from me in another thread about it but I didn’t get any feedback on it.
So I hope it’s fine when I am asking for some explanation here.

Hi @Marius,

Please bear with me if I’m misunderstanding.

In Cwicly, a block Class name is to be considered unique in the whole installation (even more so than the block ID which should be unique for the page). This is simply done to ensure that whenever/if you rename that class, the naming for that class is automatically applied throughout every block that has it listed as an additional class.

A block class name is always replaced by a random class name on copy/duplication because it would otherwise cause issues in the mapping of that class name (and renaming).

If you want the same class name applied to another block, you should add it inside the additional class field and not the class field (best to remove the class name completely if you want a clean output).
This is where the Copy Linked feature is useful as it automatically does this for you.

For external installations, I can see the annoyance the random name replacement could cause since you want that same class applied to the block. Certainly something to think about.

Hope that helps a bit!

1 Like

Thank you very much for the - once again - detailed explanation @Louis.

I was referring to the following post and indeed, I actually meant copying blocks to other sites (in general which also contain pages of course), I’ll try to make things more clear in the future. Sorry for that.

That was actually my intended topic.
For the same site I can see the way it works, this behaviour is crucial - so everything is fine.
Copying to other sites is not so convenient to be honest.
Since the copy/paste process improved even more in Cwicly, this is a thing which doesn’t fit in the otherwise smooth and seamless experience.