yggdrasil Posted March 10, 2016 Share Posted March 10, 2016 I'm trying to display some text if a specific department is selected and for some reason it just will not work. I tried both with ID and Name, and it will show on any department I click instead of only displaying for that specific department. I tried different combinations like: {if $department.id eq "1"}Test{/if} {if $department.id eq 1}test{/if} {if $department.name eq Sales}test{/if} Even: {if $filename eq "submitticket" and $department.id eq "1"}Test{/if} Nothing. It will not work. The page I'm trying to display this is in the template file supportticketsubmit-steptwo.tpl The text will display but for all departments. 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted March 10, 2016 Share Posted March 10, 2016 try the following... {if $department.id eq 1 or $deptid eq 1}success{else}failure!{/if} if they choose another department and then change it in the dropdown to your specific one, the "success" message won't display, but I assume that's not important; if they choose the specific department from step one, then you should see "success". 0 Quote Link to comment Share on other sites More sharing options...
yggdrasil Posted March 10, 2016 Author Share Posted March 10, 2016 Thank you, this worked: {if $deptid eq 1}Success{/if} It seems my code was correct, but I had to use deptid instead. Not sure why department.id or department.name was not working but deptid did the trick. 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted March 10, 2016 Share Posted March 10, 2016 I think $deptid only exists for client only departments - e.g they need to be logged in; if this was for a public department, then $deptid wouldn't necessary exist (unless the client was logged in)... if not logged in and public, then I think $department.id would work. 0 Quote Link to comment Share on other sites More sharing options...
yggdrasil Posted March 10, 2016 Author Share Posted March 10, 2016 I think $deptid only exists for client only departments - e.g they need to be logged in; if this was for a public department, then $deptid wouldn't necessary exist (unless the client was logged in)... if not logged in and public, then I think $department.id would work. Didn't think about that. Yes, I was testing this as a logged in user and for a non public department. Thanks again! 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.