Alt Image Tag Issue

derrickhand300
@derrickhand300
5 years ago
1,353 posts
A couple years ago i paid someone to remove the file type from my alt image tags
I have never understood the reasoning behind jamroom automatically adding ".jpg" or ".png" to every alt image tag
When I upload an image to a news article I use the file name as the caption to the image so i dont have to go into the html code and add the caption
For instance if i upload an image of a Bear I would name the file " This is a bear"...then my mod would automatically add that caption to the photo

The issue was a few years back jamroom was adding the file type to the alt tag so my captions were reading "This Is A Bear .jpg"

So again I am having to go into the code each time I upload an image and remove the file type from each alt tag

Is there a reason for this file type being added to the alt tags and how to remove it?

I am not wanting to pay again to get this done...

Also with recent updates uploading images i am experiencing a problem with the image settings being cached

Used to be once i set the image at 320 px Position float left Margin 10- it was cached for additional images....for some reason the position is no longer being cached and is now going to a default of STRETCH instead of "float left"
Thanks!


updated by @derrickhand300: 11/21/19 03:05:50AM
brian
@brian
5 years ago
10,136 posts
derrickhand300:
A couple years ago i paid someone to remove the file type from my alt image tags
I have never understood the reasoning behind jamroom automatically adding ".jpg" or ".png" to every alt image tag

"alt" tags are for accessibility - they should be a textual representation of what the HTML element is - in this case it's an image, so the image name being in the alt tag makes sense.

derrickhand300:
When I upload an image to a news article I use the file name as the caption to the image so i dont have to go into the html code and add the caption
For instance if i upload an image of a Bear I would name the file " This is a bear"...then my mod would automatically add that caption to the photo

The issue was a few years back jamroom was adding the file type to the alt tag so my captions were reading "This Is A Bear .jpg"

So again I am having to go into the code each time I upload an image and remove the file type from each alt tag

Is there a reason for this file type being added to the alt tags and how to remove it?

Where are you mainly seeing this at? Is your News Articles module a custom module or a JR module you're using for news?

derrickhand300:
I am not wanting to pay again to get this done...

Also with recent updates uploading images i am experiencing a problem with the image settings being cached

Used to be once i set the image at 320 px Position float left Margin 10- it was cached for additional images....for some reason the position is no longer being cached and is now going to a default of STRETCH instead of "float left"
Thanks!

If you're running the latest Jamroom Core 6.4 beta releases, and are using Chrome (or a Chrome derivative such as Brave, Chromium, etc.) make sure and do a REAL cache reset - if you are on a Mac it is:

Command-Shift-R

I'm not sure on Windows, but the regular "refresh" will NOT reload the JS properly, and JR Core 6.4.0+ is updating to TinyMCE 5.0 which changes a number of things. It could be there is additional changes needed - I can check the image embed module and see if I can reproduce this.


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
derrickhand300
@derrickhand300
5 years ago
1,353 posts
I am completely OK with the image name being in the alt tag just don't understand why its important for blind people to see what file type the image is.
Ive seen countless alt tags on mouse over on images on the internet and never saw one outside JR that ends in ".JPG" . GIF . PNG" etc
I think it must be a template issue- where the template updated and and i didnt have it saved correctly

Concerning the cached settings changing-its in the site builder module where you select an image to upload...in the attached image the STRETCH should be FLOAT LEFT if it were cached as in the past...
Capture.JPG
Capture.JPG  •  81KB

michael
@michael
5 years ago
7,692 posts
Usually the 'on mouse over' shows the title="" tag info not the alt="".

Got an example of where these .jpg's are being added to images that I can see?
derrickhand300
@derrickhand300
5 years ago
1,353 posts
Thanks- yes here is an example of the code- it adds the ,JPG
jamroom.JPG
jamroom.JPG  •  23KB


updated by @derrickhand300: 08/17/19 05:10:55PM
michael
@michael
5 years ago
7,692 posts
How would you ".....For instance if i upload an image of a Bear I would name the file 'This is a bear'....."

If you're using a Windows PC I believe they hide the file extension of files so you cant see them (not sure). Each file will still have a file extension.

What I think you're after is in jrUpImg in the jrEmbed_item_list.tpl file. Add:
|substr:0:-4}
to the variable used in the ALT tag to trim the last 4 characters off of whatever is there. Maybe do the same for the TITLE="" variable too.

This location is for when you open the upload an image editor and click on one of the existing images.
{$item.upimg_file_name|addslashes}
to
{$item.upimg_file_name|addslashes|substr:0:-4}
four.jpg
four.jpg  •  417KB

brian
@brian
5 years ago
10,136 posts
derrickhand300:
TRUMP2020

Let's leave politics out of the forum could we? Thanks!


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net

Tags