Copied to clipboard

Flag this post as spam?

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


  • Dave 14 posts 34 karma points
    Dec 12, 2012 @ 09:14
    Dave
    0

    Images just show up as a link but dont show "broken" link?

    Hi! First project and I get stuck... :(

    Got an html5 Aside element floated right and in the html5/css3 alone before I put it in umbraco, three images shows up just fine. Setting three field items and the names check out but it wont work. Have a articlePhoto on the same page, in the same place as the other images but that shows just fine??! Looks like this "/media/42/sidebar_1.jpg"

    What to do? It´s a local installation so I cant give a link : / Installed everything new yesterday so it´s the latest version of all the stuff! 

    Dave

  • Stephen Davidson 216 posts 392 karma points
    Dec 12, 2012 @ 10:18
    Stephen Davidson
    0

    how are your images referenced?

    src="images/imagename.jpg"

    try 

    src="/images/imagename.jpg"

    Regards,

    S

     

  • Dave 14 posts 34 karma points
    Dec 12, 2012 @ 10:25
    Dave
    0

    Hi Stephen, thanks for the fast reply! 

    I just put in that <umbraco:Itemfield="sidePhoto"runat="server"/> tag in the template and then in adminpanel chose the images via upload in the images folder of the root of the homepage/project. Then umbraco changes to /media/42/filename.jpg automatically when I save.

    Have I missed a setting somewhere so it just goes with the /images link instead? Where do I change the reference to /images/imagename.jpg ? 

    Thanks for the help! 

    Dave

  • Stephen Davidson 216 posts 392 karma points
    Dec 12, 2012 @ 10:34
    Stephen Davidson
    0

    So just to be clear in my (fuzzy) head the images that are coming from Umbraco, via the upload are wokring but the hard coded images are not working?

    S

  • Dave 14 posts 34 karma points
    Dec 12, 2012 @ 10:38
    Dave
    0

    No the other way around but no (sounds like crazy) :) 

    I got a articlephoto in the same page that via the upload works fine. But in this Aside-element, in the same page, via umbracos upload it dont work!??! Hardcode works just fine but I want them to be dynamic. Some pages have text in the aside and some just have three images. 

    Any clearer? :)

    Dave

  • Stephen Davidson 216 posts 392 karma points
    Dec 12, 2012 @ 10:42
    Stephen Davidson
    0

    right i think i understand now...if you put in 

    <umbraco:Itemfield="sidePhoto"runat="server"/>

    Then that will simply display the name and url of the image...you need an image tag of which there are various ways to do this depending on which version you are running and if you are using ImageGen (which i recommend!)

    As of V 4.11 you can use the following method

    http://24days.in/umbraco/2012/introducing-the-umbraco-image-control/

    or you can use something like the following if you use ImageGen

     

    <img src='/ImageGen.ashx?image=<umbraco:Item field="sidePhoto" runat="server" recursive="true"></umbraco:Item>&width=120&height=100&Constrain=True' alt='<umbraco:Item field="siteName" runat="server"></umbraco:Item>' class="mainLogo" valign="absmiddle"  />

     or simply.

    <img src='<umbraco:Item field="sidePhoto" runat="server" recursive="true"/>' />

     

  • Dave 14 posts 34 karma points
    Dec 12, 2012 @ 11:04
    Dave
    0

    Damn, just realised that you solved it on your first post. When checking the other image, articlePhoto, that umbracocode was set in the src="" and that´s why it worked. Just like you said. NOW it works great! 

    Thanks for the help! The noob now knows a little more :) 

    Dave

  • Dave 14 posts 34 karma points
    Dec 12, 2012 @ 11:10
    Dave
    0
  • Stephen Davidson 216 posts 392 karma points
    Dec 12, 2012 @ 11:29
    Stephen Davidson
    0

    Glad i could help, remember to mark it up as an answer..

Please Sign in or register to post replies

Write your reply to:

Draft