Page 1 of 1
[SOLVED] Customcontent and groups
Posted: Mon Jul 26, 2010 5:23 pm
by Hannibal
Hi,
I've managed to get FEU/Customcontent working (very simply) with one user/group forcing them to log-in to see a certain area of our site.
I now want to add a new group with it's own users so they can view different content.
My current code (for the one user) is:
Code: Select all
{if $customcontent_loggedin}
CONTENT
{else}
You are not logged in.
Please login using the form on the left.{/if}
What should the code be if I want something like:
Code: Select all
{if $customcontent_loggedin AND MEMBER OF GROUP 1}
CONTENT A
{else}
{IF MEMBER OF GROUP 2}
CONTENT B
{else}
You are not logged in.
Please login using the form on the left.{/if}
I had a search but either couldn't find anything, or if I did then didn't understand it!
Thanks
Re: Customcontent and groups
Posted: Mon Jul 26, 2010 5:28 pm
by jmcgin51
{if $ccuser->loggedin() && $ccuser->memberof('group1')}
CONTENT A
{elseif $ccuser->loggedin() && $ccuser->memberof('group2')}
CONTENT B
{else}
You are not logged in.
Please login using the form on the left.
{/if}
Re: Customcontent and groups
Posted: Mon Jul 26, 2010 5:33 pm
by Hannibal
Cheers for the reply. Just tried and got this Smarty Error:
string(131) "Smarty error: [in content:content_en line 3]: syntax error: unidentified token ';loggedin()' (Smarty_Compiler.class.php, line 1410)" string(126) "Smarty error: [in content:content_en line 3]: syntax error: unidentified token ';&' (Smarty_Compiler.class.php, line 1410)" string(136) "Smarty error: [in content:content_en line 3]: syntax error: unidentified token ';memberof('ttv')' (Smarty_Compiler.class.php, line 1410)" string(131) "Smarty error: [in content:content_en line 7]: syntax error: unidentified token ';loggedin()' (Smarty_Compiler.class.php, line 1410)" string(126) "Smarty error: [in content:content_en line 7]: syntax error: unidentified token ';&' (Smarty_Compiler.class.php, line 1410)" string(142) "Smarty error: [in content:content_en line 7]: syntax error: unidentified token ';memberof('channel-4')' (Smarty_Compiler.class.php, line 1410)" string(134) "Smarty error: [in content:content_en line 12]: syntax error: unclosed tag \{if} (opened line 1). (Smarty_Compiler.class.php, line 317)"
Could it be to do with the way I input the & and -> symbols? Should I use {literal} tags?
Re: Customcontent and groups
Posted: Mon Jul 26, 2010 5:55 pm
by Hannibal
Tried using {literal} tags with no joy. I've tried to input the & and > characters in both the WYSIWYG editor and the HTML editor but they're not seeming to stick
Re: Customcontent and groups
Posted: Mon Jul 26, 2010 6:03 pm
by Hannibal
Fixed it! Had to disable the WYSIWYG editor completely in order to get the & and > to stay as they should be
Re: [SOLVED] Customcontent and groups
Posted: Tue Jul 27, 2010 12:57 pm
by jmcgin51
yep - that's not unusual...