How to insert html in a tpl file


I have already create a my_custom_code.tpl in:


The tpl file contains:

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

no usergroup

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


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

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}

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.