How to write if else condition in dtl files

English! place to talk about development, programming and coding
Post Reply
sunil2012
Znuny newbie
Posts: 23
Joined: 04 Jan 2013, 12:05
Znuny Version: 3.0.10

How to write if else condition in dtl files

Post by sunil2012 »

Hi There,

I tried following lines to make some change in the .dtl file on condition basis, but it didn't work for me, it is printing everything as it is.

if($Data{"TypeID"} == 7){
<div id='ArticleTypeID'></div>
}

Please suggest how to write condition based statements in the .dtl files.

Thanks in advance
reneeb
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 write if else condition in dtl files

Post by reneeb »

There are/were "dtl:if" blocks for templates but they are deprecated. You should do the job in the .pm files...
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
Post Reply