Alt tag on image

More
14 years 9 months ago #3822 by tdhaynes
Alt tag on image was created by tdhaynes
Im am using the following code to display an image:

<!-- BOF image block -->
<?php if (isset($this->item->positions)) : ?>
<?php foreach ($this->item->positions as $field) : ?>
<div class="image field_<?php echo $field->name; ?>"> <?php echo $field->display; ?>
<div class="clear"></div>
</div>
<?php endforeach; ?>
<?php endif; ?>
<!-- EOF image block -->

Is there a way to display the image alt tag in a paragraph below the image.

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

More
14 years 9 months ago #3825 by orchid1
Replied by orchid1 on topic Alt tag on image
not natively but it could be done with a plugin

“Quality is never an accident; it is always the result of high intention, sincere effort, intelligent direction and skillful execution; it represents the wise choice of many alternatives.” William A. Foster - USMC

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

More
14 years 9 months ago #3826 by orchid1
Replied by orchid1 on topic Alt tag on image
I see how to do this
you can also alter the xml so you have the option but globally
or add the option in ondisplayfield()

sorry no time for a download but the code is below

“Quality is never an accident; it is always the result of high intention, sincere effort, intelligent direction and skillful execution; it represents the wise choice of many alternatives.” William A. Foster - USMC

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

More
14 years 9 months ago #3828 by orchid1
Replied by orchid1 on topic Alt tag on image
Code:
<label>' .$alt. '</label>
put this in your image.php file for the field plugin after every
Code:
$field->{$prop} = '<img class="hasTip" src="'. $src .'" alt ="'.$alt.'" title="'.$tip.'" />';

so your code will look something like this
Code:
$field->{$prop} = '<img class="hasTip" src="'. $src .'" alt ="'.$alt.'" title="'.$tip.'" /><label>' .$alt. '</label>';

“Quality is never an accident; it is always the result of high intention, sincere effort, intelligent direction and skillful execution; it represents the wise choice of many alternatives.” William A. Foster - USMC

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

More
14 years 8 months ago #4197 by tdhaynes
Replied by tdhaynes on topic Alt tag on image
Fantastic, worked perfectly.
Thanks for a wonderful component and excellent support.

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

Moderators: vistamediajoomlacornerggppdk
Time to create page: 0.517 seconds
Save
Cookies user preferences
We use cookies to ensure you to get the best experience on our website. If you decline the use of cookies, this website may not function as expected.
Accept all
Decline all
Essential
These cookies are needed to make the website work correctly. You can not disable them.
Display
Accept
Analytics
Tools used to analyze the data to measure the effectiveness of a website and to understand how it works.
Google Analytics
Accept
Decline