Copied to clipboard

Flag this post as spam?

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


  • Rocoeh 65 posts 86 karma points
    Jul 20, 2012 @ 15:18
    Rocoeh
    0

    width and height with page fields

    I havea pagefield

     

     <img src="<umbraco:Item field="sidebarImage" runat="server" />" />

     

    The problem is it has not with and height which will cause problems in earlier versions of ie.

    How can I get the width and height?

     

  • Jeroen Breuer 4909 posts 12266 karma points MVP 5x admin c-trib
    Jul 21, 2012 @ 18:14
    Jeroen Breuer
    1

    Looks like you're using the upload field on a content node. It might be better to use the media section since it will also give you the width and height, but it's not necessary. You could also add a width and height property to your content node and those will be updated if you upload a new image. They alias needs to be umbracoWidth and umbracoHeight and than they should be set. Than this could work (but I recommend xslt or razor):

    <img src="<umbraco:Item field="sidebarImage" runat="server" />" height="<umbraco:Item field="umbracoHeight" runat="server" />" />

    Jeroen

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies