Keyword

Customize K2 image logic administrator area.

  • Klaus Veliu
  • Klaus Veliu's Avatar Topic Author
  • Offline
  • Senior Member
More
4 years 11 months ago #171960 by Klaus Veliu
Hello,

After using K2 for many years to manage the content of the Joomla websites I feel comfortable using it.
In this case, I am using Joomla just to manage the content from the administrators,
the frontend is being served from a custom coded PHP website.

The current logic of K2 that creates 5 images for each article bothers me a lot, I can delete all the files in
media/k2/items/cache/ but this will result in not showing images on Administrator area and confusing the users.

It is possible to override the K2 component logic to retain the changes even after a component update and call the original image stored in this path media/k2/items/src/ in every image section?!

Thank you!
Attachments:

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

More
4 years 11 months ago #171988 by JoomlaWorks
Replied by JoomlaWorks on topic Customize K2 image logic administrator area.
Not without hacking the core of K2. Storage is less of an issue these days. Even with 5 resized copies of the source image, K2 still handles overall size way better than other solutions. Perhaps what's taking space for you is the "src" folder in /media/k2/items/. That folder is not used directly, but we do keep the source images there, in case a redesign requires that images are recreated to different dimensions (in combination with this script to rebuild the images >> github.com/getk2/rebuildK2imageCache).

Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

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

  • Klaus Veliu
  • Klaus Veliu's Avatar Topic Author
  • Offline
  • Senior Member
More
4 years 11 months ago #172005 by Klaus Veliu
Replied by Klaus Veliu on topic Customize K2 image logic administrator area.
This looks not that good for me,
but at least I am taking this information(Not without hacking the core of K2.) for granted as the reply comes from you :).

As Joomla offers the override feature I thought it would be a genuine way to do that, but I would try to alter the fancybox image path with Javascript.

In my case, the images "size" would not be a problem, but having useless files is not a good thing.

Thank you a lot for your reply!

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

More
4 years 11 months ago #172008 by JoomlaWorks
Replied by JoomlaWorks on topic Customize K2 image logic administrator area.
"As Joomla offers the override feature I thought it would be a genuine way to do that"

Um, no, you can't override how Joomla handles image uploading for standard articles. Not to mention Joomla does nothing to images either way (=no resizing).

And yes, you CAN override K2's backend items list and replace the image size fetched to one that you don't delete. No need to use JS there.

Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

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


Powered by Kunena Forum