FatihYldrm Posted February 6, 2017 Share Posted February 6, 2017 This code works on supoortticketlist.tpl page but not on viewticket.tpl page. <span class="label status {if is_null($ticket.statusColor)}status-{$ticket.statusClass}"{else}status-custom" style="border-color: {$ticket.statusColor}; color: {$ticket.statusColor}"{/if}>{$ticket.status|strip_tags}</span> 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted February 6, 2017 Share Posted February 6, 2017 This code works on supoortticketlist.tpl page but not on viewticket.tpl page. you can't take code from one template, paste it into another template and expect it to work - the same variables are not available in all templates. you'd need to add {debug} to the end of the template code to open a popup window of variables available to that template... the variable you want might be there under another name, or it might not exist at all. 0 Quote Link to comment Share on other sites More sharing options...
FatihYldrm Posted February 6, 2017 Author Share Posted February 6, 2017 you can't take code from one template, paste it into another template and expect it to work - the same variables are not available in all templates. you'd need to add {debug} to the end of the template code to open a popup window of variables available to that template... the variable you want might be there under another name, or it might not exist at all. How can I use this area in the sidebar on the same page? 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted February 6, 2017 Share Posted February 6, 2017 you wouldn't need to - the css bg color code for each ticket status is already defined, so you just need to use the correct class, based on the ticket status value. 0 Quote Link to comment Share on other sites More sharing options...
FatihYldrm Posted February 6, 2017 Author Share Posted February 6, 2017 you wouldn't need to - the css bg color code for each ticket status is already defined, so you just need to use the correct class, based on the ticket status value. But I have to assign class value automatically 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted February 6, 2017 Share Posted February 6, 2017 But I have to assign class value automatically and you can - the class for each ticket status is defined in the css, so you can call it in a similar way to your code above. 0 Quote Link to comment Share on other sites More sharing options...
FatihYldrm Posted February 6, 2017 Author Share Posted February 6, 2017 and you can - the class for each ticket status is defined in the css, so you can call it in a similar way to your code above. The above code on Supportticketlist.tpl page works fine but it can not assign automatic still on viewticket.tpl page. 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted February 6, 2017 Share Posted February 6, 2017 The above code on Supportticketlist.tpl page works fine but it can not assign automatic still on viewticket.tpl page. it can - if you use the *correct* variables. i've already told you about {debug} to get the correct variable; about the css classes to get the bg colors - if you know both of them, you can display the ticket status with the appropriate bg color. 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.