broken layout with { if $ccuser->loggedin() }

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
whitebean
New Member
New Member
Posts: 3
Joined: Fri Feb 18, 2011 5:50 pm

broken layout with { if $ccuser->loggedin() }

Post by whitebean »

Hi

I am running CMSMS 1.9.3 on PHP Version 5.3.5. I have everything set up and working but am running into problems using the frontenduser() module. I have it all set up so that the user logs in and is redirected to a content page, but I want to make the content page invisible to the none logged in users. Currently on the page I have

{ if $ccuser->loggedin() }
show content or do a redirect
{else}
<p>This is a private area.</p>
{cms_module module=FrontEndUsers form="login" nocaptcha="1" returnto="$current-volunteer-login"}
{/if}

placed in the content area (I also have WYSIWYG disabled). Trouble is it seems that the { if $ccuser->loggedin() } command is breaking the layout. The page is loading, but not displaying the login box or the appropriate content and it looks like the style sheet is not working, so only a partial page. If I take out all the smarty commands, but leave the {cms_module module=FrontEndUsers form="login" nocaptcha="1" returnto="$current-volunteer-login"} it works. Any ideas? Am I making sense? I have tried to look everywhere for the answer, so please forgive me if I have made a simple error.
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: broken layout with { if $ccuser->loggedin() }

Post by Dr.CSS »

When you say you have tiny disabled, do you mean you turn it off then add the code?...

If so tiny does come back on for a split second when you hit submit, either set tiny to not start on page load or just hit apply and go to another part of the admin, hit apply then hit the Content link in the top menu, this will get you out of that page edit w/o letting tiny come back on, but the next time you edit that page it will eat your code...

Tiny tends to turn > into &grt; is most likely why it messes with the layout...
whitebean
New Member
New Member
Posts: 3
Joined: Fri Feb 18, 2011 5:50 pm

Re: broken layout with { if $ccuser->loggedin() }

Post by whitebean »

Thanks for the quick response.

In the options tab on the Edit content page I have disabled the checkbox with "Disable WYSIWYG editor on this page (regardless of template or user settings):
"

I think my next path of action will be to try to put the smarty command into template rather than the page content and see if I have successs with that. It's probably a better way of doing it anyway.
whitebean
New Member
New Member
Posts: 3
Joined: Fri Feb 18, 2011 5:50 pm

Re: broken layout with { if $ccuser->loggedin() }

Post by whitebean »

Arghh! right I have found the problem. I did not have the Custom Content module installed, I thought I had -but it seems to have gone. have now installed have success.

I think leaving the smarty commands in the template rather than the content is a good move though.
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: broken layout with { if $ccuser->loggedin() }

Post by Dr.CSS »

A lot of times I make a new template just for the login stuff, a copy of original, then put all the logic in them, like if not logged in redirect to page x etc. that way you can have specific menus for logged in uses, stuff like that...
Post Reply

Return to “CMSMS Core”