2015-09-28 66 views
2

也許我剛剛用完了我的Google mojo,但我無法弄清楚這一點:如何設置Sitecore 8默認登錄重定向/開始頁面?

在Sitecore 8用戶設置中,我可以爲每個用戶設置一個「起始URL」 - 換句話說,頁面/網址,用戶在登錄成功後被定向到。設置此值的界面看起來是這樣的:

enter image description here

如果我點擊關閉桌面並點擊保存,該StartUrl字段的值設置爲/sitecore/shell/default.aspx,並且用戶被重定向到經典「燈塔」桌面。

如果我點擊關閉內容編輯和點擊保存,該StartUrl字段的值設置爲/sitecore/shell/applications/clientusesoswindows.aspx和用戶被重定向到內容編輯,有效/sitecore/shell/Applications/Content editor.aspx(一個額外的重定向時)。

如果我點擊關閉默認和點擊保存,該StartUrl字段的值設置爲空字符串,並且用戶被重定向到Launchpad的事,有效地/sitecore/shell/sitecore/client/Applications/Launchpad.aspx

我的問題是:如何更改默認行爲,即我怎麼決定該用戶被重定向到,如果他或她選擇默認?我希望他們在默認情況下轉到內容編輯器,他們並不喜歡Launchpad。

回答

0

當您選擇默認在用戶管理器,它能夠有效地設置用戶配置文件StartUrl值清空。這只是在用戶登錄後將您的網站導向/sitecore

/sitecore有一個302重定向到發射臺。我還沒有制定出設定的地方。

一個選項是自定義loggingin管道。造成這種情況的默認設置是:

<loggingin argsType="Sitecore.Pipelines.LoggingIn.LoggingInArgs"> 
    <processor mode="on" type="Sitecore.Pipelines.LoggingIn.ClearCache, Sitecore.Kernel" /> 
    <processor mode="on" type="Sitecore.Pipelines.LoggingIn.CheckClientUser, Sitecore.Kernel" /> 
    <processor mode="on" type="Sitecore.Pipelines.LoggingIn.CheckStartUrl, Sitecore.Kernel" /> 
</loggingin> 

你可以在代替CheckStartUrl處理器添加一個新的處理器,如果StartUrl是空的,它更新到您的默認的設置等...

類似這樣的*:

public class CustomCheckStartUrl : CheckStartUrl 
{ 
    protected override bool ValidateStartUrl(LoggingInArgs args) 
    { 
     var isValid = base.ValidateStartUrl(args); 

     // override the default start url 
     if (string.IsNullOrWhiteSpace(args.StartUrl)) 
     { 
      args.StartUrl = Sitecore.Configuration.Settings.GetSetting("MyDefaultStartPage", string.Empty); 
     } 

     return isValid; 
    } 
} 

並將其修補到管道中。

*未測試代碼