Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Silverstripe 3.1 CMS split view - preview redirect


Reply


2 Posts   366 Views

Avatar
BenWu

Community Member, 90 Posts

15 March 2014 at 6:06am

Hello,

I found one problem with the split view:

I got some script to redirect a page to another depending on what user group is logged in to the site. Unfortunately, when the editor try to edit this page in the CMS, he is redirected the whole thing to another page.

I wonder if there is a way to disable the preview panel totally? Personally, i think the preview panel is just a distraction. and it doesn't work well for complex websites.

thanks!

Avatar
Double-A-Ron

Community Member, 604 Posts

25 March 2014 at 9:30pm

So are you checking the group before the redirect? And are the groups with access to the CMS preview different groups?

What you do in this case is over in your code where you do the redirect, you give it a bypass if an Admin (or whatever group you choose) user is already logged in so it doesn't happen in preview mode.

if(!Permission::check('ADMIN')) {
// Redirect
}

The one trouble I have found with this is that this also applies if an admin is logged in to the CMS and ventures over to the frontend. This code will bypass the redirect and behaviour might not be as expected depending on how your app works. Shouldn't be a problem if the Frontend logins use Silverstripe's member class too.