I can see all the tagged items with the intro image
Only images with no spaces in the name are shown
Joomla 5.2.3 without 3d party extensions. PHP 8.3
I know that putting spaces in image or folder names is not a good practice, but our clients may not know that and anyway it is allowed by the media manager.
| Labels |
Added:
No Code Attached Yet
|
||
Maybe, i don't know if the images of RSS and tag list are processed in the same way.
The problem does not occur in layout blog view o article view: images with spaces are shown correctly.
| Labels |
Added:
PBF
|
||
Confirmed (5.3.0-beta1)
Is it ok to post links here from my PBF instance?
Confirmed on 5.3.0-beta1
Since this is not recommended for accessibility, SEO, and browser consistency reasons why are we even allowing it / entertaining allowing spaces in filenames? (I know I am going to get beaten up for that but figured I'd ask lol)
Agreed! It would be great to have a file name sanitisation system, as JCE already does natively, for example. It would not create backward compatibility problems and would help a lot in the future.
| Labels |
Removed:
PBF
|
||
It is 6.0.1, Issue still confirmed.
Im loading images from other websites and the ones with spaces couldnt load in Tagged items list.
Solved!
Change the following code in component->com_tags->tag->default_items.php:
Orginal file (around line 94 to 99):
<?php $images = json_decode($item->core_images); ?>
<?php if ($this->params->get('tag_list_show_item_image', 1) == 1 && !empty($images->image_intro)) : ?>
<a href="<?php echo Route::_(RouteHelper::getItemRoute($item->content_item_id, $item->core_alias, $item->core_catid, $item->core_language, $item->type_alias, $item->router)); ?>">
<?php echo HTMLHelper::_('image', $images->image_intro, $images->image_intro_alt); ?>
</a>
<?php endif; ?>
Replace with the following code:
<?php $images = json_decode($item->core_images); ?>
<?php if ($this->params->get('tag_list_show_item_image', 1) == 1 && !empty($images->image_intro)) : ?>
<?php
// 1. Get the raw image path (e.g., "images/my image.jpg")
$imagePath = $images->image_intro;
// 2. Explicitly encode spaces in the path for the URL (e.g., "images/my%20image.jpg")
$encodedPath = str_replace(' ', '%20', $imagePath);
// 3. Prepend the site root to create the full image URL
$fullImagePath = Uri::root(true) . $encodedPath;
?>
<a href="<?php echo Route::_(RouteHelper::getItemRoute($item->content_item_id, $item->core_alias, $item->core_catid, $item->core_language, $item->type_alias, $item->router)); ?>">
<img src="<?php echo $this->escape($fullImagePath); ?>" alt="<?php echo $this->escape($images->image_intro_alt); ?>">
</a>
<?php endif; ?>
Hope you enjoy!
That is not the solution
That is not the solution
Worked for me in joomla 6.0.1. Image of items under Tagged items list now visible even if they have spaces in their name. Of cours it should be fixed in the joomla core, but little template override may help until then.
duplicate report of #43742 ?