lukaskleinschmidt / kirby-sortable

Making subpage managing a breeze
79 stars 6 forks source link

Multilang titles in module overview #31

Closed olach closed 7 years ago

olach commented 7 years ago

In the module overview, the title shown on each module is from the title field of the module. This title field is saved upon creation of the module.

Would it be possible to show the (translated) name of the master module, instead of the saved title of the created module instance?

I'm asking, because I've run into some problems on a multi language site.

If I use translation strings inside yaml site/modules/mymodule.yml:

title:
  de: Mein Modul
  en: My Module
  sv_SE: Min Modul

If I create a new instance of this module, the current title translation is then saved in the title field of the created module automatically. And it is this saved title field that is shown on the overview list. This is not good if several authors with different languages are editing pages with modules. For example, if I am creating some modules, the Swedish translation is used and saved as the title field. This Swedish translation is then shown in the overview list. This is not good, because later when an english author is logged in, this Swedish translation is shown in the overview list.

So, I would like to propose to change this behavior so the translated name of the master module is shown in the overview list instead.

lukaskleinschmidt commented 7 years ago

You can easily add a custom layout for your modules. I put together a small example to get you started.

https://github.com/lukaskleinschmidt/kirby-sortable-layout

olach commented 7 years ago

Thanks, good to know that it's possible to change the appearance of the overview.

But, I would still suggest to change the default logic, to output the translated blueprint name of the module. It makes much more sense to show the title of the created module, than showing a custom title. The first thing I want to know when looking at the overview is to know what type of modules that are created. And this info should be shown in the correct language for the author. If I want to show some actual content of a module, then I'll use the preview functionality of your plugin.

When I work with modules, I'm trying to keep the number of available fields to a minimum, to make it easy for the editors. The title field is the first field that I remove/hide from the module blueprint. For example, if I create an "image gallery" module, I might have fields to select images and to create image captions etc. There is no need for a separate title field where its only purpose is to change the module title in the module overview. In the overview, all I want is to show the title of the type of module I have created. In this case an "image gallery".

But, in those cases I do want to have a specific appearance in the overview, for example to distinguish between several created similar modules, then I do have the option to utilize the preview functionality of your plugin.

lukaskleinschmidt commented 7 years ago

I get your point but I don't want to change the default behaviour (yet). I often use the title to identify which module im currently looking at. To distinguish between different module types I use the module icon which I choose accordingly.

I keep this issue open. Perhaps some others want to share their opinions.