Jump to content

text with hyperlink in module admin page


Trampino

Recommended Posts

Hello, I am beginner in PS module ceration. I need to place short text with hyperlink to conrete place at PS module admin page. But I do not know how?

 

I found only this way.

 

$fields_form[0]['form'] = array(
        'legend' => array(
        'title' => $this->l('Read documentation first! ').'<a href="../modules/mymodule/docEN.pdf" target="_blank">EN</a>',
        )
    );  

 

 

It works, but it is not exactly what I want. Becaese form's rectangle is displayed. 

 

Is there any better way how to place text with hyperlink to requested place at PS module admin page?

 

Thanks for your help.

Edited by Trampino (see edit history)
Link to comment
Share on other sites

yes, there is. You can override form by type.
 
first create your field type: for example
 
$fields_form = array(
'legend' => array(
'title' => $this->l('Add/edit procedure')
),
'input' => array(
array(
'type' => 'hidden',
'name' => 'id_procedure'
),
array(
'type' => 'display_img',
'name' => 'display_img'
),....
 
there is "display_img" custom type
 
then create file
 
your module name\views\templates\admin\_configure\helpers\form\form.tpl
 
file content looks like that: 
 
{extends file="helpers/form/form.tpl"}
{block name="input"}
{if $input.type == 'display_img'}
<img src="{$fields_value['current_img']}" style="max-width: 100px;" />
{else}
{$smarty.block.parent}
{/if}
{/block}

 

don't forget in form params add $helper->module = $this; 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...