Best practice for modifying core tt files in custom packages?

English! place to talk about development, programming and coding
Post Reply
hkais
Znuny expert
Posts: 280
Joined: 16 Apr 2016, 08:55
Znuny Version: see in post
Real Name: Hans
Contact:

Best practice for modifying core tt files in custom packages?

Post by hkais »

Hi there,

I am wondering what the best practice is to extend core files?
e.g. I would like to extend in the AgentTicketZoom a feature which we would like to use to have a clickable Queue in TicketInformation.tt

Sadly it is not clear how to extend this in the template file? Means is there something like inheritance and polymorphism to use?

What is the best practice here?
Especially having in mind to be "upgradable" for future releases of Znuny, which would be bad if I simply overwrite the .tt file
Elected 2022-06 as an IT Governance Portal Expert. The portal for Znuny, OTRS and OTOBO users
hkais
Znuny expert
Posts: 280
Joined: 16 Apr 2016, 08:55
Znuny Version: see in post
Real Name: Hans
Contact:

Re: Best practice for modifying core tt files in custom packages?

Post by hkais »

no hints here?
Elected 2022-06 as an IT Governance Portal Expert. The portal for Znuny, OTRS and OTOBO users
Johannes
Moderator
Posts: 391
Joined: 30 Jan 2008, 02:26
Znuny Version: All of them ^^
Real Name: Hannes
Company: Znuny|OTTERHUB

Re: Best practice for modifying core tt files in custom packages?

Post by Johannes »

If you only want to modify TT files there are two ways:
1) Put it in the Custom Folder
2) Create a custom Template folder and use it as "DefaultTheme" in the Sysconfig
If there are updates, they have to be applied on the go. You can't just modify single lines of a template and inherit the rest, if this is not a module already.

3) Use a OutputFilter (POST) like Frontend::Output::FilterText###OutputFilterTextAutoLink
More reliable. Works on already rendered templates. But depends on your usecase.

You can decide which of both ways works best for you.

Hope this helps
Post Reply