ALT Caption in Images
Page 1 of 1 • Share •
ALT Caption in Images
Hi, everyone!
Hope you're enjoying a brilliant day!
I would like to ask if there's a possibility to use the ALT caption for images by using BBCode. This, as HTML doesn't work in the custom profile fields in my forum.
I've read in some forums it works this way:
[img alt="Image text"] http://www.website.net/image.jpg [/img]
It doesn't work in mine, though.
I'd appreciate your help!
Thank you very much!

I would like to ask if there's a possibility to use the ALT caption for images by using BBCode. This, as HTML doesn't work in the custom profile fields in my forum.
I've read in some forums it works this way:
[img alt="Image text"] http://www.website.net/image.jpg [/img]
It doesn't work in mine, though.
I'd appreciate your help!

Thank you very much!
Re: ALT Caption in Images

My forum's English4Fun. It's a PHPBB3 forum and I'm working with text zone profile fields.
Thank you for your help!
Re: ALT Caption in Images
Hi again AnaMi! Well, please give me a link to a topic in that you have tried this code?
Anyway, this code doesn't work. Works only attributes on tables in bbcode. The example below doesn't work:
Anyway, this code doesn't work. Works only attributes on tables in bbcode. The example below doesn't work:
- Code:
[img alt="text"]image[/img]
- Code:
[td colspan="3"]text[/td]
Guest- Guest
Re: ALT Caption in Images

I want to use the caption for the images in one of the custom profile fields which is displayed in the profile as well as the messages. If you go to this link, for instance, you'll see the user Misor has a profile field with an image. The idea is to add a caption to that picture.
Re: ALT Caption in Images
Ok, try to add in javascript management:
- Code:
jQuery(document).ready(function() {
jQuery('img').each(function() {
if(jQuery(this).attr('src') == 'LINKTOIMAGE') jQuery(this).attr('alt', 'ALTTEXT');
});
})
Guest- Guest
Re: ALT Caption in Images


After creating this Javascript code, can I use HTML or the ALT property for the BBCode instead?


Re: ALT Caption in Images
If you use the image list profile field, then just add your text in "Alternate text" (:
Re: ALT Caption in Images

Just one more question: once I add this JavaScript code, how can I use BBCodes with the Alt caption in a post?

Re: ALT Caption in Images
So, I think you can activate HTML and use alt attribute. You cannot with bbcode because in HTML a image structure code is:
So, using a example:

Now see in Chrome with Inspect element, or with Mozilla Firefox how it looks as HTML.
- Code:
<img src="LINK" alt="TEXT" title="TEXT" />
- Code:
[img]LINK[/img]
So, using a example:

Now see in Chrome with Inspect element, or with Mozilla Firefox how it looks as HTML.

- Code:
<img src="http://illiweb.com/fa/fdf/parchemin.png" alt="" class="" style="display:inline">
Guest- Guest
Re: ALT Caption in Images

HTML has always worked in my forum, even with the ALT caption code. My hope was to find a way to use the ALT caption in a custom profile field (text zone), which only accepts BBCode so far. Sadly, it doesn't work.


Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum