mailto in field text is posible?

Topics: Customizing Orchard
Nov 8, 2012 at 8:08 PM


just that. attempt transform a text field that contains an email address in it, in a field automatic sending of email through mailto. is there a way of altering the source code to achieve that effect?


Nov 8, 2012 at 8:10 PM

Can't you just override the template to do that? This being said, mailto: links are a really bad idea. Better to have a contact form that hides the address from spammers.

Nov 8, 2012 at 8:57 PM

about mailto: is an intranet site so the spam is not a problem :D 

about override: you have an example of how you could do the correction template??



Nov 9, 2012 at 12:17 AM

Nov 12, 2012 at 12:07 PM


thanks for the link, I was very useful so I could create my own view I leave the text for those who can be helpful.
greetings and thank you very much bertrandleroy

gracias por los link, me fue de mucha utilidad asi pude crear mi propia vista dejo el texto para quien pueda serle util.
saludos y muchas gracias bertrandleroy.

@using Orchard.Utility.Extensions;
    string name = Model.ContentField.DisplayName;

@if (HasText(name) && HasText(Model.Value)) {
    <p class="text-field"><span class="name">@name:</span> <span class="value"><A HREF=mailto:@Model.Value>@(new MvcHtmlString(Html.Encode((HtmlString) Model.Value).ReplaceNewLinesWith("<br />$1")))</A></span></p>