Copy and paste components


#1

I know, I know - it’s been mentioned before.

A couple of days back I wanted to make 12 buttons of the same design. Set the colour, enable icon, choose icon (annoyingly tedious locating the same icon time and time again), set to square shape, set label.

Rinse and repeat another 11 times. Really tedious

Norm, I know you mentioned that it would be hard to do, but I’m struggling to understand why an item’s assets couldn’t be duplicated as attributes for a new item.

A copy and paste is just the same as:

Copy item attributes,
Insert new item.
Set new item to have the same attributes as those saved.

I was in a hurry copying those buttons and doing that simple job became very tedious.

It would be great to see Copy & Past in Blocs.

Paul


#2

The problem is how paste would work, most would expect copy and paste to copy a full item (HTML etc) and then paste to paste the copied item in a location on a page. The problem with this is related to how Blocs works regarding adding new items (as it’s fixed to the natural page flow), if you just select a page and then choose to paste, were does the item go? What bloc is it added too, at what position inside the row? So now consider you then need to select an area to paste too, which comes with an array of new potential edge cases, what if you have selected to paste a Bloc inside a Bloc? How would that work? I could spends months on this or pay someone thousands to develop it but in the end it could still end up rubbish because of the way items are structured in Blocs. It’s a big challenge, not to add it but to get it right.

However, your comments did spark off an idea in my head. Copy attributes would be easier, I’ve never thought to try that, I’ve always been more focused on copy and pasting actual page objects not their settings. It could be like copying layer styles in Photoshop, that could work.

I understand the limitations and the problems copy and paste eliminates, I have been actively working on adddressing them, however they may not be in the form of copy and paste but the problem will be solved.

You will see a new feature in 2.4 that addresses a long standing copy and paste issue, many have requested since version 1 :sunglasses:


#3

Whenever I’ve had to move an item from page to page (last time was a form) I duplicated it, moved to global area, and opened the target page and moved it from there. Then I deleted the original. Most associated settings stuck, but that was 1 item, and slow.
I get the inability to cut/paste so I wasn’t too fussed, but 12…!!!


#4

Thanks Norm.

If I have the bric menu open and select a bric, my mouse pointer shows the bric I have chosen. As my mouse moves, the blue line appears showing where that will be dropped.

If I select something in blocsapp it tells me what I have selected, so it should be possible to copy everything, to do with that component (including anything nested inside) just like blocaspp does when duplicating.

If I then initated a paste operation then blocsapp could then behave as though I was inserting that component, so the cursor would change and the blue line would appear, as though an insertion was being made. If you were super-clever the cursor would be the similar to an insertion being made.

This is fine for brics.

Blocs might be a bit more challenging because the placement works slightly differently on creation, but the great thing about a blocs is that they are easy to move, so putting one in the wrong place isn’t a massive issue, but you could even implement the blue line cursor for bloc pastes.

If you can crack this then the re-use possibilities for blocs goes up massively. Instead of re-creating that design wheel all the time I could re-use designs I have made. Copy and paste elements between files? yes please!

There’s a bit of a caveat when copying and pasting between files - custom classes. You’d need to bring in custom classes too and that might cause name clashes. There are ways around this, the simplest being to abandon the import of a specific custom class if it already existed in the file being pasted into. It would be nice to be told that had happened. It would also be great not to worry about class name clashes if the custom classes in both files were equivalent (but retain the custom class attribute on the imported item).

If you can crack this Norm, then we have the ability to use templates and create design libraries to accelerate site builds.

Of course, my button problem would be solved with an asset paste, which would be a step in the right direction, though I hadn’t envisaged that as a specific operation (I mentioned copying assets as a way of implementing the pasting of brics).

Paul


#5

The responsibility of classes will always be down to the creator of a template. A template should be created with a unique custom class structure so it doesn’t get in the way of standard stuff regardless of app, merging classes with the same names would be a disaster. Just like wp plugins or themes, classes would in most part need to be unique to a template. Then you can merge all kinds of stuff but it does effect the size of style sheets.


#6

I might make 5 websites or themes and want a new one taking blocs from all five files.

If I am consistent about class naming, I don’t see why there should be an issue.

If I am inconsistent, it’s my problem. So merging classes with the same names is an entirely understandable and reasonable thing to do. My “red-dot-pink-button” class might be used in many designs.


#7

Yes, that is a way to solve it.
I did it with forms - only that the ids eg. “email” will be extended by 1233 for example wicj is than a bit confusing in your answer mail.


#8

Thanks for idea. I lately stuck with moving a form from one page to another … :stuck_out_tongue:

By the way, I think there is still NO chance to build any complicated project without a Bootstrap help files and basic understanding of it … :slight_smile: So … :wink:


#9

Everything I know about bootstrap started from blocsapp. You can use blocsapp without knowing about bootstrap. I doubt that many blocsapp users have looked at the bootstrap help files.


#10

… and this is the goal Norm tries to achieve.
He’s on a good road.


#11

That’s why i used the “complicated” word… :wink: Blocs App is the most friendly app I used till now and very helpful with great potential. Because of that I still enjoy it and try to help to develop it. Lately i started really big project (big for one person) using this app. Today i acheved the advanced stage. It seems to it will be done successfuly. (!) My joy is big. Blocs makes my work easier.