[SOLVED]RenderBlockStar

Moderator: crythias

Post Reply
jafumega27
Znuny newbie
Posts: 28
Joined: 09 Mar 2015, 14:41
Znuny Version: 4.0.5
Real Name: Tiago Rocha

[SOLVED]RenderBlockStar

Post by jafumega27 »

hi,

Anyone know where i can find the information from, RenderBlockStart, in the .tt files?

for example, RenderBlockStart("DynamicField")? how the otrs know where have to search in the DB?

Cumps
Last edited by jafumega27 on 16 Mar 2015, 17:24, edited 1 time in total.
RStraub
Znuny guru
Posts: 2210
Joined: 13 Mar 2014, 09:16
Znuny Version: 6.0.14
Real Name: Rolf Straub

Re: RenderBlockStar

Post by RStraub »

It works like this:

1) in the .xml file (Kernel/Config/Files) you register a perl module.
2) For each RenderBlock entry you saw in the .tt file, the perl module creates a "block", e.g.:

Code: Select all

 $Self->{LayoutObject}->Block(
            Name => 'NameOfTheRenderBlock',
            Data => {
                %{ $Self->{Config} },
                Name        => $Self->{Name},
                NameHTML    => $NameHTML,
                RefreshTime => $Refresh,
            },
        );
3) This Perl Module calls a template file, e.g.:

Code: Select all

    my $Content = $Self->{LayoutObject}->Output(
        TemplateFile => 'NameOfTheTemplateFile',
        Data         => {
            %{ $Self->{Config} },
            Name => $Self->{Name},
        },
        KeepScriptTags => $Param{AJAX},
    );
With this, you can use all the attributes passed with the Data hash in the .tt file. In this example that would be Name, NameHTML and RefreshTime.
Currently using: OTRS 6.0.14 -- MariaDB -- Ubuntu 16 LTS
Post Reply