Problems, need help? Have a tip or advice? Post it here.
5 posts Page 1 of 1
Hi KK,

For the mail address obfuscated by Couch - if users haven't got JavaScript enabled, there is the following message:
(Please enable JavaScript to view this email address)

I would like to localize the text but cannot find it in lang/en.php or kfunctions.php.

Is there a possibility to localize it?

Thanks for any hints!

Solaris
You can make use of the 'msg' parameter for the 'cloak_email' tag.
Code: Select all
<cms:cloak_email email=my_mail_address msg='(Please enable JavaScript to view this email address)' />
Thanks, cheesypoof, that's a clever solution!
Any idea on how to achieve this when using the shortcode method for displaying the email address?

Solaris
As we can see from the original 'mailto' documentation short code, the relevant portion of the code is in blue:
<?php
// Obfuscate email
// Usage: [mailto]email@mydomain.com[/mailto]
$FUNCS->register_shortcode( 'mailto', 'mailto_handler' );
function mailto_handler( $params, $content=null ){
global $FUNCS;

// Create Couch script.. we'll use the 'cloak_email' tag to encrypt email
$html = "<cms:cloak_email email='{$content}' />";

// Pass on the code to Couch for execution using the 'embed' function
return $FUNCS->embed( $html, $is_code=1 );
}

Now with the additional parameter added which you can change:
<?php
// Obfuscate email
// Usage: [mailto]email@mydomain.com[/mailto]
$FUNCS->register_shortcode( 'mailto', 'mailto_handler' );
function mailto_handler( $params, $content=null ){
global $FUNCS;

// Create Couch script.. we'll use the 'cloak_email' tag to encrypt email
$html = "<cms:cloak_email email='{$content}' msg='(Please enable JavaScript to view this email address)' />";

// Pass on the code to Couch for execution using the 'embed' function
return $FUNCS->embed( $html, $is_code=1 );
}
Great, thanks a lot for showing the details! :)

Solaris
5 posts Page 1 of 1