Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Muhammad hussain 33 posts 53 karma points
    Aug 16, 2010 @ 06:04
    Muhammad hussain
    0

    Add Alt tag editor to images in Umbraco

    Hi All,

    I want to add alt tage to image in umbraco. Can any one help me.

     

    Thanks

    Hussain

  • Dirk De Grave 4541 posts 6021 karma points MVP 3x admin c-trib
    Aug 16, 2010 @ 08:00
    Dirk De Grave
    0

    just add a new property on the image media type, of type textstring, and use that property if wish to spit it out on the frontend using the GetMedia() function (just as you would output the filename). For a GetMedia reference, see this wiki article (targets 4.5 release)

    Hope this helps.

    Regards,

    /Dirk

  • Richard 146 posts 168 karma points
    Aug 16, 2010 @ 10:15
    Richard
    0

    Alternatively use the node name of the image as the alt tag value, for images displayed with an XSLT macro, and where $imageid is the node ID of the image picked on a page with current Media property:

     

    <xsl:if test="$imageid!=''">
    <xsl:variable name="image" select="umbraco.library:GetMedia($imageid, 'false')"/>

    <img src="{$image/data[@alias = 'umbracoFile']}" width="{$image/data[@alias = 'umbracoWidth']}" height="{$image/data[@alias = 'umbracoHeight']}" alt="{$image/@nodeName}"/>
    </xsl:if>
Please Sign in or register to post replies

Write your reply to:

Draft