Hello. I would like to be able to pass variable data to a dtl (template) file. For example, the Article.dtl file has some data passed to it in the Body field which I would like to modify. Please let me know a way to do this.
Thanks in advance for any info...Dan.
How to pass data to template
Moderator: crythias
-
- Znuny advanced
- Posts: 135
- Joined: 04 Jun 2013, 23:14
- Znuny Version: 3.3.3
- Real Name: Dan Stover
- Company: EMAC, Inc.
How to pass data to template
OTRS 3.3.3
Ubuntu 12.04
MySQL DB
Ubuntu 12.04
MySQL DB
-
- Znuny guru
- Posts: 5018
- Joined: 13 Mar 2011, 09:54
- Znuny Version: 6.0.x
- Real Name: Renée Bäcker
- Company: Perl-Services.de
- Contact:
Re: How to pass data to template
In the .pm files (e.g. Kernel/Modules/AgentTicketPhone.pm) you'll find something like or . The hash passed to "Data" contains all the values for the template. This might also help: http://doc.otrs.org/developer/3.3/en/ht ... anism.html
Code: Select all
$Self->{LayoutObject}->Block(
Name => '...';
Data => {
...
},
);
Code: Select all
$Self->{LayoutObject}->Block(
TemplateFile => '...';
Data => {
...
},
);
Perl / Znuny development: http://perl-services.de
Free Znuny add ons from the community: http://opar.perl-services.de
Commercial add ons: http://feature-addons.de
Free Znuny add ons from the community: http://opar.perl-services.de
Commercial add ons: http://feature-addons.de
-
- Znuny advanced
- Posts: 135
- Joined: 04 Jun 2013, 23:14
- Znuny Version: 3.3.3
- Real Name: Dan Stover
- Company: EMAC, Inc.
Re: How to pass data to template
Thank you very much. I will look into that.
OTRS 3.3.3
Ubuntu 12.04
MySQL DB
Ubuntu 12.04
MySQL DB
-
- Znuny advanced
- Posts: 135
- Joined: 04 Jun 2013, 23:14
- Znuny Version: 3.3.3
- Real Name: Dan Stover
- Company: EMAC, Inc.
Re: How to pass data to template
I think I see how that works. What I really need is to bring up an activity dialog screen with an article field with predefined values in the article fields. I see that Article.dtl is where this comes from initially but how do I pass data to that so that the fields are filled in?
Any ideas? Thanks...Dan.
Any ideas? Thanks...Dan.
OTRS 3.3.3
Ubuntu 12.04
MySQL DB
Ubuntu 12.04
MySQL DB
-
- Moderator
- Posts: 10170
- Joined: 04 May 2010, 18:38
- Znuny Version: 5.0.x
- Location: SouthWest Florida, USA
- Contact:
Re: How to pass data to template
Do you want to pass client side, server side, or via URL?
OTRS 6.0.x (private/testing/public) on Linux with MySQL database.
Please edit your signature to include your OTRS version, Operating System, and database type.
Click Subscribe Topic below to get notifications. Consider amending your topic title to include [SOLVED] if it is so.
Need help? Before you ask
Please edit your signature to include your OTRS version, Operating System, and database type.
Click Subscribe Topic below to get notifications. Consider amending your topic title to include [SOLVED] if it is so.
Need help? Before you ask
-
- Znuny advanced
- Posts: 135
- Joined: 04 Jun 2013, 23:14
- Znuny Version: 3.3.3
- Real Name: Dan Stover
- Company: EMAC, Inc.
Re: How to pass data to template
I would think server side. I do not want the client side to know that it happened. I just want to bring up an activity dialog screen that includes a normally blank article with the article fields filled in (Subject, Body, attachments, etc.) from a previously entered article. I think I can get the data from the previous article and save it behind the scenes if I can figure out how to load that activity dialog screen.
Thanks...Dan.
Thanks...Dan.
OTRS 3.3.3
Ubuntu 12.04
MySQL DB
Ubuntu 12.04
MySQL DB