proper use of if if else

Discussion in 'Developing, APIs and extending' started by saionmane, Sep 7, 2012.

  1. saionmane

    saionmane Member

    <{if $_ticketDepartmentTitle == "test" }>
    content
    <{if $_ticketDepartmentTitle == "test2" }>
    content
    <{/if}>
    <{else}>
    content
    <{/if}>
    please any one explain clear how to use if if else condition or if elseif else proper condtion.
    And i want to know how to manage each department for template. for create new ticket reply.
    thank
     
  2. Gary McGrath

    Gary McGrath Staff Member

    Hi there,

    The basic structure is

    <{if $_ticketDepartmentTitle == "test"}>
    Some stuff here
    <{/if}>

    If you then want to add extra conditions, you can use this, for a switch between one or another
    (e.g. if department = test, some stuff here, if department != test, differrent stuff here)

    <{if $_ticketDepartmentTitle == "test"}>
    Some stuff here
    <{else}>
    Different stuff here
    <{/if}>

    You can then also add in elseif commands

    Gary
     
  3. saionmane

    saionmane Member

    Thank Gray now i am trying to change template in forward html and it there any way to control template for each department?
    coz i try to add header and footer inside the email_ticketforwardhtml and email_ticketstaffreplyhtml.
    we have 3 different header and footer so i need to manage each department for their own header and footer.
    what i do now is i use if <{if $_ticketDepartmentTitle == "TAP - Accounting" || $_ticketDepartmentTitle == "Oasis Luxury Reservation" }>
    some stuff
    </if>
    but it is not ok when we have many department and change department name than we have to change coding again.
    so i just want to know how to manage each department template?
    how do we use template group?
    thank
     

Share This Page