Copied to clipboard

Flag this post as spam?

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


  • Max 144 posts 166 karma points
    Oct 11, 2011 @ 14:20
    Max
    0

    Image media item now showing in IIS

    Hi I Uploaded my umbrao project in IIS and there is a tempalte file which is suppose to show the image in my local pc its showing properly

    but it creates a image ulr like this :

     <img src='~/media/2824/25.jpg' height="200px" width="300px"/><br/>

    here is the template field

     <img src='<umbraco:Item field="newsPhoto" runat="server"></umbraco:Item>' height="200px" width="300px"/><br/>

     

    is there anyway i can get rid of the ~ item here

    it happens after i upload it in IIS

     

  • Rodion Novoselov 694 posts 859 karma points
    Oct 11, 2011 @ 14:35
    Rodion Novoselov
    0

    Hello. What is the document type 'newsPhoto' property itself? 

  • Max 144 posts 166 karma points
    Oct 12, 2011 @ 07:31
    Max
    0

    its the alias of upload property itself thank you in that particular document type

    thank you any suggestions

     

  • wolulcmit 357 posts 693 karma points
    Oct 12, 2011 @ 08:09
    wolulcmit
    0

    Hi there,

    you should be able to get around this by changing a setting in http://our.umbraco.org/wiki/reference/webconfig/additional-umbraco-specific-appsettings

    this post might also be of help
    http://our.umbraco.org/forum/templating/templates-and-document-types/21168-Upload-Media-path

    also, if you're running the latest Umbraco version
    you could just write some inline razor

    <umbraco:Macrorunat="server"language="cshtml">
              <imgsrc='@Model.NewsPhoto
    'alt=''/>
    </umbraco:Macro>

     

  • wolulcmit 357 posts 693 karma points
    Oct 12, 2011 @ 08:12
    wolulcmit
    0

    sorry that should have some spaces in it

    <umbraco:Macro runat="server" language="cshtml">
              <img src="@Model.NewsPhoto"
    alt="@Model.Name"/>
    </umbraco:Macro>

    and you can of course use double quotes.

    @Model is your friend.

    - Tim

  • Rodion Novoselov 694 posts 859 karma points
    Oct 12, 2011 @ 08:34
    Rodion Novoselov
    0

    Hi, you need to use the Item control to insert this property to the template.
    Something like this:

      <umbraco:Item runat="server" field="newsPhoto"
             insertTextBefore="&lt;img src=&quot;"
    insertTextAfter="&quot; alt=&quot;&quot;/&gt;" />

    Another approach can be to create a reusable macro for rendering such images.

  • 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