Jump to content

Sort Blocks in the Backend


nurkka
 Share

Recommended Posts

I am trying to sort the blocks in the page editor via "sort" and "sortGroup", but they are still sorted alphabetically.

image.png.7ba9a87b02248077845a3f93aa213480.png

I tried every combination of "group", "groupSort" and "sort" with and without various values, but with no luck.
Does anyone know how to sort the blocks?

Additional question: Is there a feature to copy/clone blocks within the page editor?

Thanks in advance!

Link to comment
Share on other sites

Hey @nurkka thx for your question!

I think that I just changed this as some point in time as I've never really been using the sort feature. It turned out to be less useful than I thought and having them sorted alphabetically with a filter input seemed the better option. I think it should be quite easy though to restore the old behaviour via config setting. Would that help?

Or are you just playing around with it and I can remove that info from the docs?

3 hours ago, nurkka said:

Additional question: Is there a feature to copy/clone blocks within the page editor?

This is unfortunately not possible at the moment 🙈

 

Link to comment
Share on other sites

Thanks @bernhard !

I am using RockPageBuilder for the first time and already in a real client project, which I have to finish until next week 🙂 The project is a small company website with at most six to seven different block types per page. But for the client resp. the person who will be adding new content pages, it would be great, if the blocks had the same order as they are appearing in the layout and on already finished pages.

So it would be great if you could add back the sorting. But if the sorting has unwanted side effects, then it would surely be better to just remove it from the docs ...

Regarding the copy/clone feature: That would be a great addition! I built some websites and also content management backends for onlineshops with RepeaterMatrix, and when I talked to the clients afterwards, the copy mechanism is always something they are using really often. Would be great to have this available also in RockPageBuilder!

Link to comment
Share on other sites

2 minutes ago, nurkka said:

But for the client resp. the person who will be adding new content pages, it would be great, if the blocks had the same order as they are appearing in the layout and on already finished pages.

What do you mean exactly? 🙂 

Link to comment
Share on other sites

Sorry! I meant it would be easier for editor users, if the blocks in the page editor could have the same order as they have initially regarding to the given layout of the page. For example let's say every page always starts with a HeroImage, but the corresponding block would be the fifth in the list of available blocks. So the editors will have to search through the blocks to find the right one to start with, and so on.

Of course, they can move the blocks around. But in my experience, they won't do that. They will always follow the same order of blocks. Therefore, I thought they would benefit from pre-sorted blocks, as they can go through them from left to right.

Or am I misunderstanding something? I meant the sort order of the "create new block of type XY" icons. 🙂 

  • Thanks 1
Link to comment
Share on other sites

Hey @nurkka I have something for you 😎

Please download v5.9.0 https://www.baumrock.com/en/releases/rockpagebuilder/

0oXeNb7.gif

All you have to do is add a hook like this to /site/ready.php:

wire()->addHookAfter(
  'RockPageBuilder::getPresets',
  function (HookEvent $event) {
    $page = $event->arguments(0);
    $field = $event->arguments(1);
    if ($page->template != 'blogitem') return;
    if ($field->name != 'rockpagebuilder_blocks') return;
    $event->return = [
    'Demo' => [
      'Alert',
      'Features',
      'Features',
      'Videos',
    ],
  ];
});

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...