Copied to clipboard

Flag this post as spam?

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


  • Warren Caulton 2 posts 102 karma points
    Jul 20, 2017 @ 14:39
    Warren Caulton
    0

    Link To Media ver.7.6.4

    On my website I have a Link to media /media/1005/(myimage.jpg) Clicking on the link takes me to http://media/1005/(myimage.jpg) instead of http://(mywebsite)/media/1005/(my_image.jpg).

    I have a local version of Umbraco where I am integrating my own MVC controllers to use Progress Controls for my Data Display and Exports. I build in VS 2017, and publish the result to a File Folder on my 2008 IIS Web Server.

    How can synch the Media data between my Development Environment and my Production Environment?

  • Alex Skrypnyk 5908 posts 22603 karma points MVP 4x admin c-trib
    Jul 20, 2017 @ 14:55
    Alex Skrypnyk
    0

    Hi Warren

    Can you show the code that renders an image?

    Thanks,

    Alex

  • Warren Caulton 2 posts 102 karma points
    Jul 20, 2017 @ 16:20
    Warren Caulton
    100

    The Page code is:

    <div class="col-lg-5">
            <img style="padding-top:16px;" src="/Images/vintage_kohler_ad_upd.jpg" height="395">
        </div>
    

    The Template code is:

     <div class="col-lg-5">
            @{
                var typedMediaPickerSingle = Model.Content.GetPropertyValue<IPublishedContent>("bannerImage");
                if (typedMediaPickerSingle != null)
                {
                    <img style="padding-top:16px;" src="@typedMediaPickerSingle.Url" alt="" height="395" />
                }
            } 
        </div>
    

    After updating the Template the page source now reads:

    <div class="col-lg-5">
                    <img style="padding-top:16px;" src="/Kinsley2017/media/1006/kds_arrives_002.jpg" alt="" height="395">
    
        </div>
    

    The Template didn't get updated on the server. Your request for code cleared that up. Thanks

  • Amir Khan 1199 posts 2567 karma points
    Jul 20, 2017 @ 18:15
    Amir Khan
    0

    So you're just wanting the domain in the request?

    If so you can just put this before your call to @typedMediaPickerSingle.Url: @HttpContext.Current.Request.Url.Host

    Hope this helps!

    Amir

  • 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