1-888-365-2779
+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / Adding E-mail field to Image Module

Adding E-mail field to Image Module

4 posts, 0 answered
  1. PJulicher
    PJulicher avatar
    24 posts
    Registered:
    08 Apr 2010
    13 Apr 2010
    Link to this post
    Hi,

    What do I have to do, to have an E-mail field added to the Image Gallery. I managed to create Text fields. One of the fields holds an e-mail address. On the Image Gallery page, I want the text "E-mail" to appear that has a link to the entered E-mailaddress.

    Help........

    Gr, Patrick 
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    14 Apr 2010
    Link to this post
    Hello PJulicher,

    You could create a metakeys in case you want to persist the email address data. On the public template you could have Label that shows "Email address" and anchor control that gets the data from the metakey.

    For instance you could add the following in the public template

    <a href="mailto:email@domian.com?subject=<asp:Literal runat='server' Text='<%# ((CmsContentBase)Container.DataItem).GetMetaData("CustomValue").ToString().Replace("&", "%26")%>' />

    You could use the same expression for the mail as for the subject if you store the email as metakey

    Greetings,
    Ivan Dimitrov
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  3. PJulicher
    PJulicher avatar
    24 posts
    Registered:
    08 Apr 2010
    15 Apr 2010
    Link to this post
    Hi Ivan,

    At the moment we have the code like this:

    <asp:HyperLink ID="EmailAddress" NavigateUrl="mailto:" runat="server" rel="EmailAddress" Text="E-mail" />

    This shows the e-mail address with a link to the same e-ailaddress. How can I change this, so that not the E-mailadress is visible on the website, but the text E-mail? The link should stay the same.

    Gr, Patrick
  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    16 Apr 2010
    Link to this post
    Hi PJulicher,

    If you use this Hyperlink in a custom or user control you should see only its text "E-mail". The link is visible only on hover. You could take a look at the attached screenshot. You could also use
    <a href="mailto:....">some text</a>

    Regards,
    Ivan Dimitrov
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Register for webinar
4 posts, 0 answered