templates based on FEU group

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Post Reply
jmcgin51
Power Poster
Power Poster
Posts: 1899
Joined: Mon Jun 12, 2006 9:02 pm

templates based on FEU group

Post by jmcgin51 »

I want to change the layout, colors, or other template-controlled features of a page, based on the user's FrontEndUser id.  I had thought that I could just create one giant master template file that will actually contain each desired template, with each template protected by appropriate CustomContent tags.  Then I use the master template file on each page, and the CC tags ensure that the appropriate template is displayed to the appropriate users. 

BUT, I can't protect stylesheets with CC tags, can I?

Is there a way to accomplish different page layouts based on the user's FEU id?
cyberman

Re: templates based on FEU group

Post by cyberman »

jmcgin51 wrote: I had thought that I could just create one giant master template file that will actually contain each desired template,
Think the parsing of such an giant master template will eat too much of your server power.
BUT, I can't protect stylesheets with CC tags, can I?
One of possible ways could be:

Code: Select all

{cms_module module=CustomContent}
{if customcontent_loginname == 'member'}
   {stylesheet name='member'}
{else}
  {stylesheet name='guest'}
{/if}
Place this in head area (haven't tried yet).

If you read at modules help you will see the other way too  ;) ...
jmcgin51
Power Poster
Power Poster
Posts: 1899
Joined: Mon Jun 12, 2006 9:02 pm

Re: templates based on FEU group [SOLVED]

Post by jmcgin51 »

thanks, Cyberman!
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm

Re: templates based on FEU group

Post by calguy1000 »

Yes, this will work for the stylesheets, cyberman's syntax is a bit off, but it's close.

However, you'll want to use the latest and greatest SVN copy of CMS, or 1.0.3 when it comes out, as there's a bug fix in template caching that will cause you problems if you don't have it.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
jmcgin51
Power Poster
Power Poster
Posts: 1899
Joined: Mon Jun 12, 2006 9:02 pm

Re: templates based on FEU group

Post by jmcgin51 »

ok, thanks!
cyberman

Re: templates based on FEU group

Post by cyberman »

calguy1000 wrote: cyberman's syntax is a bit off,
Please correct me - I'm not a coder for real. I've only tried to adapt the help ;D.
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm

Re: templates based on FEU group

Post by calguy1000 »

This should work:

{cms_module module=CustomContent}  <<-- Not needed/color]

Code: Select all

{if $customcontent_memberof_Users}
   {stylesheet name='member'}
{else}
  {stylesheet name='guest'}
{/if}
Actually, I think the {cms_module module=CustomContent} tag isn't needed at all any more.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
Post Reply

Return to “CMSMS Core”