Copied to clipboard

Flag this post as spam?

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


  • Rik Helsen 670 posts 873 karma points
    Jun 17, 2015 @ 14:32
    Rik Helsen
    0

    Need to fetch "image url" from a node property for use in email signature

    I want to centrally manage the image and hyperlink in our email signatures. I have a nodetype that holds "URL" and a "Mediapicker"

    easy part: i need to have site.com/emailsignature node redirect to the URL (forwarding users). I can easily do this in the page template.

    but then i also need to have site.com/signature.jpg always load the media image that is currently selected in the mediapicker.

    What approaches do you suggest?

    enter image description here

  • Rik Helsen 670 posts 873 karma points
    Jun 18, 2015 @ 07:54
    Rik Helsen
    0

    it feels dirty but it works ;)

      @inherits Umbraco.Web.Mvc.UmbracoTemplatePage
    @{
        Layout = null;
    }
    
    
    
    @* Redirect incoming links with querystring www.orbitone.com/email-signature?redirectlink=true to the target URL *@
    @{
        string redirectlink = Request["redirectlink"];
        if(!String.IsNullOrEmpty(redirectlink)) {
            Response.Redirect(CurrentPage.targeturl);  
        }
    }
    
    
    
    @* Redirect incoming links with without querystring to the banner image *@
        @if (CurrentPage.signatureimage != null && !(CurrentPage.signatureimage is Umbraco.Core.Dynamics.DynamicNull))
    {
        var m = Umbraco.Media(CurrentPage.signatureimage);
    
        Response.Redirect(@m.Url);  
    
    }
    
Please Sign in or register to post replies

Write your reply to:

Draft