Hi
I am trying to cloak a email where the admin user can add edit it in the cms side and it's using a globals masterpage so I have done the following but no email address is displayed
My kfunctions.php looks like the following
My includes/header.php looks like the following
In the cms side I added [mailto]email@domain.co.uk[/mailto]
I followed this guide viewtopic.php?f=4&t=7044 but unsure what I have done wrong
Update: I thought it may of been due to the field type being text in the globalstwo.php file so changed it to richtext and can see it's now richtext type in the cms side but does still not show the email address. Is there something else I need to do for shortcodes to work in includes/header.php file?
I am trying to cloak a email where the admin user can add edit it in the cms side and it's using a globals masterpage so I have done the following but no email address is displayed
My kfunctions.php looks like the following
- Code: Select all
<?php
$FUNCS->register_shortcode( 'googlemap', 'googlemap_handler' );
function googlemap_handler( $params, $content=null ){
global $FUNCS, $CTX;
extract( $FUNCS->get_named_vars(array(
'map' => ''
), $params) );
return '<iframe src="'.$map.'" width="100%" height="400px" id="mapcanvas" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" style="border:0" allowfullscreen><div id="map" style="height:400px;width:100%;"></div></iframe>';
}
// 6.
// 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 \"<cms:get_custom_field 'header_email_link' masterpage='globalstwo.php' />\" />";
// Pass on the code to Couch for execution using the 'embed' function
return $FUNCS->embed( $html, $is_code=1 );
};
?>
My includes/header.php looks like the following
- Code: Select all
<li>
<a href="<cms:do_shortcodes><cms:show header_email_link /></cms:do_shortcodes>">
<i class="bx bx-envelope"></i>
Email: <cms:do_shortcodes><cms:show header_email_link /></cms:do_shortcodes>
</a>
</li>
In the cms side I added [mailto]email@domain.co.uk[/mailto]
I followed this guide viewtopic.php?f=4&t=7044 but unsure what I have done wrong
Update: I thought it may of been due to the field type being text in the globalstwo.php file so changed it to richtext and can see it's now richtext type in the cms side but does still not show the email address. Is there something else I need to do for shortcodes to work in includes/header.php file?