How to insert html in a tpl file

Hello,



I have already create a my_custom_code.tpl in:

skins[color=#000000][font=Tahoma][size=3]/[/size][/font][/color]basic[color=#000000][font=Tahoma][size=3]/[/size][/font][/color]customer[color=#000000][font=Tahoma][size=3]/[/size][/font][/color]addons[color=#000000][font=Tahoma][size=3]/[/size][/font][/color]my_changes[color=#000000][font=Tahoma][size=3]/[/size][/font][/color]blocks[color=#000000][font=Tahoma][size=3]/[/size][/font][/color]static_templates



The tpl file contains:


{if $usergroup.usergroup_id == "3"}




usergroup
{$usergroup.usergroup_id}
{$usergroup.usergroup}
{else}
no usergroup
{$usergroup_links.usergroup_id}
{$usergroup.usergroup}
{/if}




I put a block in my homepage and i selected the my_custom_code.tpl



Why the tag if $usergroup.usergroup_id doesn't work?



Thanks in advance

Try:-


{if $smarty.session.auth.usergroup_Ids && $smarty.session.auth.usergroup_Ids|in_array:3}
your code
{/if}


You need to access the session info because that is where it can be derrived which usergroup the user is a member of.

Hello StellarBytes,



I tried this but nothing, it doesn't work.

This appears in a lot of frontend templates where usergroups are concerned:-



{if !"ULTIMATE:FREE"|fn_allowed_for}
{assign var="usergroups" value="C"|fn_get_usergroups}
{/if}


Can't say for certain why your if statement would fail, but this might be worth a shot. The code I posted in post #2 worked in V2/3.