Output HTML On New Tab

Hi folks,

I have a requirement where-by I have created a new scripted field (contains HTML) (not utilising studio) and im using the api to populate this. What I now need to do is output the content of this field and render it as HTML.

The field should display within a new tab within the Products module without any form label etc and just purely output the value.

Please can anyone share any suggestions?

1 Like

@CNSam
Welcome to community!

You can use parameter customCode for forms editviewdefs.php or/and detailviewdefs.php and you can leave blank label for the field. For exmple:

...
'LBL_PANEL_0' => array (
     0 => array (
         0 => array (
            'name' => 'field_api_html',
            'customCode' => '<span class="label" style="font-size: larger;">{$fields.field_api_html.value}</span>',
        ),
    ),
),
...

Why not use the standard iframe field that you can add from Studio?

1 Like

We aren’t hosting the page anywhere so not able to use iframe.

I did try using the afore mentioned customCode but it just output the html code and didn’t render it as html.

:confused:

See this to get Smarty to leave your HTML in place as it is:

@CNSam

As a variant you can set field type function (There is type=>int in example change it). Look at the post. Function can return html.

2 Likes