Output clickable link with mailto: from text input?

Permalink Browser Info Environment
Hi Jordan,

I'm wondering if there is a way to have a text field that receives an email address as plain text show up in the finished block as a clickable link that displays the email address and when clicked has the mailto: link behind it?

I have this:
<?php  echo htmlentities($field_11_textbox_text, ENT_QUOTES, APP_CHARSET); ?>
   <a href="<?php  echo $link_url; ?>" target="_blank"><?php  echo $link_text; ?></a>
   </br>
<?php  endif; ?>


but I can't seem to get it spit out the format I want. I tried swapping it with URL portion of the block builder but it didn't work for me. I'm hoping to avoid rebuilding from scratch, so I thought I'd check in with your first.

Thanks in advance!

Type: Discussion
Status: In Progress
TooqInc
View Replies:
jordanlev replied on at Permalink Reply
jordanlev
Sure, all you have to do is put "mailto:" in front of the email address in the href of the link. For example:

<a href="mailto:<?php echo $link_url; ?>"><?php echo $link_text; ?></a>
TooqInc replied on at Permalink Reply
TooqInc
Wow. I was way over-thinking this. I also had failed to update the variable name properly. Everything is working great now. Thanks Jordan!

concrete5 Environment Information

# concrete5 Version
5.6.3.3

# concrete5 Packages
Ajax Form (1.3), Basic Forum (1.0), Designer Content (3.1.1), eCommerce (2.8.12), Expand / Collapse (1.2.6), Major Marketing (2.0.4.5), PC5 Custom Templates (3.5), Print my page (1.0.3), Pro Blog (12.4.4), reCAPTCHA (0.9.0), Slate Theme (1.4), Social Icons Reloaded (2.0), Sortable Fancybox Gallery (1.17), tnSpacer (1.3).

# concrete5 Overrides
single_pages/page_not_found.php

# concrete5 Cache Settings
Block Cache - On
Overrides Cache - On
Full Page Caching - On - If blocks on the particular page allow it.
Full Page Cache Lifetime - Every 6 hours (default setting).

# Server Software
Apache/2.2.29 (Unix) mod_ssl/2.2.29 OpenSSL/1.0.1e-fips mod_bwlimited/1.4

# Server API
cgi-fcgi

# PHP Version
5.5.21

# PHP Extensions
bcmath, calendar, cgi-fcgi, Core, ctype, curl, date, dom, ereg, filter, ftp, gd, hash, iconv, imap, intl, ionCube Loader, json, libxml, mbstring, mcrypt, mysql, mysqli, mysqlnd, openssl, pcre, PDO, pdo_mysql, pdo_sqlite, Phar, posix, Reflection, session, SimpleXML, soap, sockets, SourceGuardian, SPL, sqlite3, standard, tokenizer, xml, xmlreader, xmlrpc, xmlwriter, Zend OPcache, zip, zlib.

# PHP Settings
max_execution_time - 30
log_errors_max_len - 1024
max_file_uploads - 20
max_input_nesting_level - 64
max_input_time - 60
max_input_vars - 1000
memory_limit - 32M
post_max_size - 8M
sql.safe_mode - Off
upload_max_filesize - 2M
mysql.max_links - Unlimited
mysql.max_persistent - Unlimited
mysqli.max_links - Unlimited
mysqli.max_persistent - Unlimited
pcre.backtrack_limit - 1000000
pcre.recursion_limit - 100000
session.cache_limiter - nocache
session.gc_maxlifetime - 7200
soap.wsdl_cache_limit - 5
opcache.max_accelerated_files - 2000
opcache.max_file_size - 0
opcache.max_wasted_percentage - 5

Browser User-Agent String

Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.115 Safari/537.36

Hide Post Content

This will replace the post content with the message: "Content has been removed by an Administrator"

Hide Content

Request Refund

You may not request a refund that is not currently owned by you.