lukaskleinschmidt / kirby-sortable

Making subpage managing a breeze
79 stars 6 forks source link

Easier way of disabling default actions #34

Closed adamcbrewer closed 7 years ago

adamcbrewer commented 7 years ago

Might be nice to have the option to remove the copy & paste actions globally when using type: sortable.

Perhaps something like:

c::set('sortable.field.add', true);
c::set('sortable.field.copy', false);
c::set('sortable.field.paste', false);

I just couldn't figure out how to do this following the instructions in the Customize section in the readme.

lukaskleinschmidt commented 7 years ago

Sorry for the long delay but I was on vacation last week.

I actually think this could be a good addition. But I'm not quite sure if this should be a global option or something that can be set in the blueprint. I will have a closer look at this but I think the blueprint option would be best.

It would be great if I could get me some feedback regarding the customazation. For me everything is clear but I get that it is not the easiest thing to do. Some random points where you get stuck would help alot.

adamcbrewer commented 7 years ago

Well maybe not in config then, you're right. It would either be too controlling or otherwise complex when wanting to control everything on a per-page level.

So perhaps then a field for actions or buttons? Obviously all of them – add, copy, paste, edit, etc. – are enabled by default, but specifying a list of them will only enable those? I'm thinking something much like the buttons field for textarea's.

fields:
  projects:
    label: List of Project Pages
    type: sortable
    actions:
      - add
      - edit
      - delete
lukaskleinschmidt commented 7 years ago

Actually the modules filed (it is just an extended sortable field) you can already do all of this. https://github.com/lukaskleinschmidt/kirby-sortable/tree/master/fields/modules#blueprint

I left the source field (sortable) pretty basic so it can be easily edited for any specific need.

I will put something together so you can use the features of the modules field.

adamcbrewer commented 7 years ago

Amazing, thanks!

lukaskleinschmidt commented 7 years ago

Have a look here

https://github.com/lukaskleinschmidt/sortable-plus

adamcbrewer commented 7 years ago

Thanks @lukaskleinschmidt , that's perfect!