如何使用href插入文本来记录SugarCRM中的视图字段
我们希望提供任何文字或记录的链接
答案 0 :(得分:2)
custom/modules/your_module/metadata/detailviewdefs.php
array (
'name' => 'temp_c',
'label' => 'LBL_TEMP',
'customCode' => '{if $fields.temp_1_c.value}
<a href="{$fields.temp_1_c.value}" target="_blank">
<img src="imgname.png" alt="Img" width="25" height="25" />
</a>
{/if} />',
),
答案 1 :(得分:0)
只需创建URL类型字段:以下是代码:
$dictionary['module_name']['fields']['website'] = array (
'labelValue' => 'Website',
'required' => false,
'name' => 'website',
'vname' => 'LBL_WEBSITE',
'type' => 'url',
'massupdate' => '0',
'default' => '',
'no_default' => false,
'comments' => '',
'help' => '',
'importable' => 'true',
'duplicate_merge' => 'disabled',
'duplicate_merge_dom_value' => '0',
'audited' => true,
'reportable' => true,
'unified_search' => false,
'merge_filter' => 'disabled',
'len' => '255',
'size' => '20',
'dbType' => 'varchar',
'gen' => '',
'link_target' => '_blank',
);
文件位置应为: custom \ Extension \ modules \ module_name \ Ext \ Vardefs \ sugarfield_website.php