Kirby Sortable Field / Modules Field

The modules folder under site?

I meant the the content folder.

site_/
    content/
        site-where-modules-appear/
            modules <- the container folder

Nope. There is no such container folder. Is this new? Rendering the page works as before.

I can’t reproduce the error. Could you please check on a startkit or plainkit. Or send me a .zip of your project (or a part of it) that produces this error? It’s very hard to debug this remotely.

No need to be sorry @lukaskleinschmidt. Your plugin deserved to have life on its own and I’m also super excited for the new release. Great work man!

v2.3.0

  • Added PHP 5.4 support
  • Any problems regarding the array_filter() function should now be solved
  • paste and duplicate now trigger the panel.page.create event
5 Likes

Works great here!

I like this mouseOver-feature:

:smiley:

Thanks a lot!

2 Likes

Hi guys, for some reason I don’t get the manually ordered sortable fields into the frontend, e.g. sortBy(ā€˜title’, ā€˜asc’ ) works but not the manual order (sortBy(ā€˜sort’, ā€˜asc’)). I might messed up something in my blueprint. I’m using ā€œsortable: trueā€ (under fields) but in the content file there seems to be an outdated list of the fields, which does not get updated. Any hint?

page structure:
page > skills > (skills I want to sort)

content file:
Sortable: skill-1hv3ppt, skill-1gfc4gp, skill-13ei241, skill-c5ovmx

I am currently on vacation and only have my mobile phone with me. You can try something like this.

$containerPage->find($page->sortable());

Ok finally found my issue. My fields were not visible, that’s why the sorting didn’t work. Thanks!

Hi @lukaskleinschmidt,

This is a French translation for your amazing plugin :slight_smile:

<?php
return array(
  'field.sortable.empty' => 'Aucune page pour le moment.',
  'field.sortable.or' => 'ou',
  'field.sortable.add.first' => 'Ajouter la premiĆØre page',
  'field.sortable.paste.first' => 'ajouter du presse-papiers',

  'field.sortable.limit' => 'Limite atteinte',
  'field.sortable.limit.template' => 'Limite atteinte pour ce modĆØle',

  'field.sortable.add' => 'Ajouter',
  'field.sortable.add.template.label' => 'Ajouter une nouvelle page',
  'field.sortable.add.error.template' => 'Le modĆØle est manquant',

  'field.sortable.copy' => 'Copier',
  'field.sortable.copy.uri.label' => 'Copier dans le presse-papiers',
  'field.sortable.copy.info.label' => 'Aucune page pour le moment',
  'field.sortable.copy.info.text' => 'Il n\'y a aucune page que vous pouvez stocker dans le presse-papiers pour le moment.',
  'field.sortable.copy.error.uri' => 'Selectionner au moins une page',

  'field.sortable.delete' => 'Effacer',
  'field.sortable.delete.page.label' => 'Voulez-vous vraiment effacer cette page ?',

  'field.sortable.duplicate' => 'Dupliquer',
  'field.sortable.edit' => 'Editer',

  'field.sortable.paste' => 'Coller',
  'field.sortable.paste.uri.label' => 'Coller du presse-papiers',
  'field.sortable.paste.uri.help' => 'Un ou plusieurs modĆØle ne sont pas disponibles',
  'field.sortable.paste.info.label' => 'Le presse-papiers et vide',
  'field.sortable.paste.info.text' => 'Il n\y a aucune page stockƩe dans le presse-papiers pour le moment.',
  'field.sortable.paste.error.uri' => 'Selectionner au moins une page',
  
  'field.sortable.hide' => 'Cacher',
  'field.sortable.show' => 'Montrer',
);

Regards
Gilles

1 Like

Thank you for that. Could you please also provide the translations for the Module and Section variants?

Yes, I will send you them here in fews minutes …

1 Like

Module French translation:

<?php
return array(
  'field.sortable.empty' => 'Aucun module pour le moment.',
  'field.sortable.add.first' => 'Ajouter le premier module',

  'field.sortable.add.template.label' => 'Ajouter un nouveau module',

  'field.sortable.copy.info.label' => 'Aucun module pour le moment',
  'field.sortable.copy.info.text' => 'Il n\'y a pas encore de modules que vous puissiez stocker dans le presse-papiers.',
  'field.sortable.copy.error.uri' => 'Selectionner au moins un module',

  'field.sortable.delete.page.label' => 'Voulez-vous vraiment effacer ce module ?',

  'field.sortable.paste.info.text' => 'Il n\'y a pas de modules stockƩs dans le presse-papiers pour le moment.',
  'field.sortable.paste.error.uri' => 'Selectionner au moins un module',
);

Sections French translation:

<?php

return array(
  'field.sortable.empty' => 'Aucune section pour le moment.',
  'field.sortable.add.first' => 'Ajouter la premiĆØre section',

  'field.sortable.add.template.label' => 'Ajouter une nouvelle section',

  'field.sortable.copy.info.label' => 'Aucune section pour le moment',
  'field.sortable.copy.info.text' => 'Il n\'y a pas encore de sections que vous puissiez stocker dans le presse-papiers.',
  'field.sortable.copy.error.uri' => 'Selectionner au moins une section',

  'field.sortable.delete.page.label' => 'Voulez-vous vraiment effacer cette section ?',

  'field.sortable.paste.info.text' => 'Il n\'y a pas de sections stockƩes dans le presse-papiers pour le moment.',
  'field.sortable.paste.error.uri' => 'Selectionner au moins une section',
);

Thanks just added it to the repo.
For any imitators. I would also accept a pr for that :wink:

Hey there I’m pretty new to kirby and just came across this awesome plugin.
I installed the plugin and set the sortable list in my blueprint. But I dont really understand
how to create modules and to show them in my layout/template. I appreciate any help :slight_smile:

The sortable field helps you ordering subpages.
One way would be to use it in conjuncion with the modules plugin. Then you can use the modules field which also comes with this plugin.

Or you just use plain subpages and use the stored page order to retrieve those pages.

$moules = $page->find($page->sortable())->visible();

foreach($modules as $module) {
  // Do something
}

Thanks for your answer i will give it a try :slight_smile:

Did anyone use the field with Kirby 2.5.4? I’m only getting the error

The parent page could not be found

ON the parent page. This is how I configured the page with should contain the blocks:

title: Baukasten-Seite
pages:
  template:
    - module.text
    - module.gallery
  hide: true
fields:
  title:
    label: Titel
    type:  text
  modules:
    label: Blƶcke
    type: modules
    variant: sections
    actions:
      - edit
      - duplicate
      - delete
      - toggle