I need to create a custom block above the default forms on Contacts page. I've tried to add php function in contacts.php. Below is a sample cod from contacts.php. I've highlighted what I've added in bold. However, it does not return anything in front end. The content for _CONTACT_TEXT is in the Language settings.
Where am I going wrong? How do I create custom php code to display new block on contacts page?
// --------------- page components
$showForm = getParam('enable_contact_form') == 'on' ? true : false ;
$_ni = $_page['name_index'];
if( $showForm ) {
$_page_cont[$_ni]['page_main_code'] = PageCompMainCode();
$_page_cont[$_ni]['page_main_code'] = PageCompPageMainCodeWithForm();
}
else {
$_page_cont[$_ni]['page_main_code'] = PageCompPageMainCode();
}
// --------------- [END] page components
PageCode();
// --------------- page components functions
/**
* page code function
*/
function PageCompPageMainCode() {
global $oTemplConfig;
return DesignBoxContent( _t('_CONTACT_H1'), MsgBox(_t('_CONTACT')), $oTemplConfig->PageCompThird_db_num);
}
function PageCompMainCode() {
global $oTemplConfig;
$ret = _t( "_CONTACT_TEXT");
return DesignBoxContent( _t("_CONTACT_H"), $ret, $oTemplConfig -> PageCompThird_db_num );
}
function PageCompPageMainCodeWithForm() {
global $oTemplConfig, $site;
etc. .....