Security

Reply
Contributor I
Posts: 27
Registered: ‎10-31-2014

Print Template if else code to list guest user ssid per guest user role

Hello community,

 

can someone help me with a code for my print template?

 

I want that the ssid name change with the user role. My code should be make:

 

If Role Name = 4 then put text "WLAN = mobile",

otherwise put text "WLAN = guest".

 

I try this but didn´t work. I don´t know something about html code.

 

{if $u.role_name} mobile
  <tr>
   <td class="nwaBody">Wlan = Mobile</td>
  </tr>

{

<td class="nwaBody">Wlan = Guest</td>

}
 {/if}

 

 

MVP
Posts: 505
Registered: ‎05-11-2011

Re: Print Template if else code to list guest user ssid per guest user role

[ Edited ]

I would think it should be something like this:

 

{if $u.role_name}
  <tr>
   <td class="nwaBody">Wlan = {if $u.role_name=mobile}Mobile{else}Guest{/if}</td>
  </tr>
{/if}

First line triggers if there exists a $u.role_name

Then third line enters Mobile as WLAN if the role equals mobile, or Guest if anything else.

 

Please note: 

tr = table row

td = table column/cell


Regards
John Solberg

-ACMX #316 :: ACCP-
Intelecom - Norway
----------------------------
Remember to Kudo if a post helped you! || Problem Solved? Click "Accept as Solution" in a post!
Contributor I
Posts: 27
Registered: ‎10-31-2014

Re: Print Template if else code to list guest user ssid per guest user role

Thanks a lot for the reply.

 

There is a syntax error with "=" can you please help?

 

{if $u.role_name}
  <tr>
   <td class="nwaBody">Wlan = {if $u.role_name=mobile}Mobile{else}Guest{/if}</td>
  </tr>
{/if}

 

Error in template: [in __template__55f68ab234ee20.31538420.html line 3]: syntax error: unidentified token '=' (Smarty_Compiler.class.php, line 296)

MVP
Posts: 505
Registered: ‎05-11-2011

Re: Print Template if else code to list guest user ssid per guest user role

Use double equals sign ==


{if $u.role_name}

Wlan = {if $u.role_name==mobile}Mobile{else}Guest{/if}

{/if}

Regards
John Solberg

-ACMX #316 :: ACCP-
Intelecom - Norway
----------------------------
Remember to Kudo if a post helped you! || Problem Solved? Click "Accept as Solution" in a post!
Contributor I
Posts: 27
Registered: ‎10-31-2014

Re: Print Template if else code to list guest user ssid per guest user role

Thanks a lot for your help.

 

Now I try to build all seetings we need in a print template.

 

Thank you so much.

 

Regards,

 

Marco

Search Airheads
Showing results for 
Search instead for 
Did you mean: