Jump to content

Can't get Department Variables to work


yggdrasil

Recommended Posts

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.

Link to comment
Share on other sites

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".

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated