SharePoint: Temporary switching PageLayout of PublishingPage in HttpModule fails

て烟熏妆下的殇ゞ 提交于 2019-12-06 15:26:25

问题


Im working on an edit/display mode switch of MasterPage and PageLayout. I asked a question on this before (How to dynamically switch PageLayout and MasterPage of SharePoint Publishing page?). The nicest approach seems to be a HttpModule where to switch MasterPage and PageLayout to edit specific variants. MasterPage switching is no problem, but the PageLayout switching results in an error.


回答1:


I found the definitive answer! Its all working now! Problem was that after publish the wrong item is cached. I flushed the item from the cache and it all works now. Also did a lot of rewriting on the code. I am now creating a WSP package for it with an activation feature, preparing the code for publication on codeplex. I will update this post as soon as the code is published.




回答2:


I found the solution. I have to update the list item, otherwise the url exeception occures. It isn't like the temporary updating the master url in the web, I have to update the list item. Doesn't really matter, there is a good SystemUpdate(false) variant that makes no versions. I did huge rewrites, but still did not get it completely working again. Sometimes the edit mode still uses the display pagelayout, and I just can't find out why. Does anyone dare to helpme debugging this. If it works we have something interesting I think. Full seperation of Edit and Display masterpages and pagelayouts. The strange thing is that the used pagelayout is lagging behind. I get sometimes a display pagelayout in edit mode, and an edit pagelayout in display mode.



来源:https://stackoverflow.com/questions/991743/sharepoint-temporary-switching-pagelayout-of-publishingpage-in-httpmodule-fails

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!