Keyword

Feature request: image inherit on multi-language

  • Jonathan Roza
  • Jonathan Roza's Avatar Topic Author
  • Offline
  • New Member
More
11 years 1 month ago #117657 by Jonathan Roza
Hello.

We have a multi-language website with a lot of items, growing in number every day.
The secondary language items are allways a direct translation of the main language, with the same images.

To reduce cache size, workload on generation of cache, and overall backup size, we would like to make all the secondary language items use the cached images of the main item.

Currently, each item have its own src image, and set of cached images in 6 sizes. So in the end, for each item (adding main and translated) we have 21 images on the server (src + 6 caches) on a 3 language website.

For this explanation, let's call the item that provide images to other items a "main-item", and then call the items that inherited images from the main-item a "img-inherited-item".

My proposal is the following:

1. On K2 settings, add a "main language" setting for image inheritance. Or get the main lang by checking which language is the default of the site. Any way is good.

2. On the image tab, add a "inherit image from item" button.
This button will open a popup with a list of items (same popup as we get when choosing a item for a menu, or a item for mod_k2_content, with filters, etc. If the list can come pre-filtered with the main language, all the better).

3. After the main-item is selected on the popup, the image will appear on the image box, and there will be a notification "image inherited from:" and then title, language, category tree (yes, the full category path), and ID of the main-item.

4. If possible, make the same for "image gallery" and "media" tabs, as this will also reduce workload for the admin.

5. Create a different image icon (on item list) for a "main-item", and another icon for a "img-inherited item", so people can easily identify when there is a image inheritance relationship.

6. Add a confirmation message on item deletion for "main-items", so the admin will know that his img-inherited-items will have a broken image if this main-item is deleted (but if the main-item is deleted, probably the img-inherited-items will be deleted as well, as they are related).

Apart from the deletion confirmation, this modification appears to be quite simple, from my point of view. You are just telling a K2 Item to use a cached image from other item (the "image" entry in the database will have the image value of the main item, and there will be some extra fields in the database for inheritance relationship information).

This seems very maintaineable, because it doesn't force changes on database structure (it just add some fields), or lots of additional code.

I hope this goes forward.

Thank you, and best regards.

Please Log in or Create an account to join the conversation.


Powered by Kunena Forum