I have somewhere between 200 and 500 subpages which need to be coppied as subpages to other pages.
It would be extremely time consuming to do this in the backend. So I went straight to the database. I started copying the rows in dbo.page for the master supbages, that I created in the backend and changed the PageParentPageID to the ID of the next parent page in the menu structure.
Imidiately I notice columns that has a different default value, then the values that the backend inserts. I took notice and changed the defaults to what the backend inserts. Now it works and I can copy the pages in a fraction of the time.
BUT! there are still situations where the backend menu won't expand to show the subpages. I checked all values, sortorder end the values of the columns I changed. I cannot see what triggers the problem.
What are the conditions in the code that drives the navigation menu. What values from the database causes it to not expand and show subpages?
Developer forum
E-mail notifications
Backend navigation incidents
Posted on 12/03/2010 09:59:20
Replies
Nicolai Høeg Pedersen
Posted on 12/03/2010 10:03:23
Navigation in backend should only depend on ID, AreaID, ParentID and Name (PageMenuText).
But there is a lot of caching and so on involved...
So after adding things to the database, try running /?Refresh=yes in the frontend, and close browser window in backend to reset JS cache.
If that does not work... I have'nt got a clue.
But there is a lot of caching and so on involved...
So after adding things to the database, try running /?Refresh=yes in the frontend, and close browser window in backend to reset JS cache.
If that does not work... I have'nt got a clue.
Posted on 12/03/2010 11:12:35
Posted on 12/03/2010 11:14:36
I cracked it. The result seems to depend on the parents settings for
PageWorkflowID
PageWorkflowState
PageVersionParentID
PageVersionNumber
PageInheritStatus
PageMasterPageID
If these differ from the parent settings, the parent menu will not expand.
Posted on 12/03/2010 11:16:22
BTW sorry for creating this thread in the wrong forum.
Posted on 12/03/2010 12:06:38
Here is a stored procedure that will copy all subpages from one page to another.
-- ================================================
-- Copyright Andersen & Blæsbjerg 2010
-- ================================================
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author: Peter Munkholm
-- Create date: 12-03-2010
-- Description: Copies subpages form one page to another
-- =============================================
CREATE PROCEDURE CopySubPages(@idFrom INT,@idTo INT)
AS
BEGIN
SET NOCOUNT ON;
INSERT INTO Page (
PageParentPageID,
PageAreaID,
PageSort,
PageMenuText,
PageActive,
PageMouseOver,
PageImageMouseOver,
PageImageMouseOut,
PageImageActivePage,
PageTopImage,
PageTextAndImage,
PageProtect,
PagePassword,
PageCreatedDate,
PageUpdatedDate,
PageShowTopImage,
PageStylesheet,
PageBackgroundImage,
PageTopLogoImage,
PageActiveFrom,
PageActiveTo,
PageShortCut,
PageShortCutRedirect,
PagePermission,
PagePermissionType,
PagePermissionTemplate,
PageAllowsearch,
PageShowInSitemap,
PageAllowclick,
PageMenuLogoImage,
PageFooterImage,
PageDescription,
PageKeywords,
PageUserCreate,
PageUserEdit,
PageRotation,
PageDublincore,
PageShowUpdateDate,
PageManager,
PageManageFrequence,
PageWorkflowID,
PageWorkflowState,
PageShowInLegend,
PageShowFavorites,
PageVersionParentID,
PageVersionComments,
PageVersionNumber,
PageCacheMode,
PageCacheFrequence,
PageInheritID,
PageInheritUpdateDate,
PageInheritStatus,
PageApprovalType,
PageApprovalState,
PageVersionTimeStamp,
PageApprovalStep,
PageTopLevelIntegration,
PageForIntegration,
PageRotationType,
PageMasterPageID,
PageTopLogoImageAlt,
PageNeedTranslation,
PageNavigation_UseEcomGroups,
PageNavigationParentType,
PageNavigationGroupSelector,
PageNavigationMaxLevels,
PageNavigationProductPage,
PageNavigationShopSelector,
Navigation_UseEcomGroups,
NavigationParentType,
NavigationGroupSelector,
NavigationMaxLevels,
NavigationProductPage,
NavigationShopSelector,
PageUserManagementPermissions,
PageUrlName,
PageHidden,
PageIsTemplate,
PageTemplateDescription,
PageMetaTitle)
(
SELECT
CAST(@idTo AS INT),
PageAreaID,
PageSort,
PageMenuText,
PageActive,
PageMouseOver,
PageImageMouseOver,
PageImageMouseOut,
PageImageActivePage,
PageTopImage,
PageTextAndImage,
PageProtect,
PagePassword,
PageCreatedDate,
PageUpdatedDate,
PageShowTopImage,
PageStylesheet,
PageBackgroundImage,
PageTopLogoImage,
PageActiveFrom,
PageActiveTo,
PageShortCut,
PageShortCutRedirect,
PagePermission,
PagePermissionType,
PagePermissionTemplate,
PageAllowsearch,
PageShowInSitemap,
PageAllowclick,
PageMenuLogoImage,
PageFooterImage,
PageDescription,
PageKeywords,
PageUserCreate,
PageUserEdit,
PageRotation,
PageDublincore,
PageShowUpdateDate,
PageManager,
PageManageFrequence,
(SELECT PageWorkflowID FROM page WHERE PageID = @idFrom),
(SELECT PageWorkflowState FROM page WHERE PageID = @idFrom),
PageShowInLegend,
PageShowFavorites,
(SELECT PageVersionParentID FROM page WHERE PageID = @idFrom),
PageVersionComments,
(SELECT PageVersionNumber FROM page WHERE PageID = @idFrom),
PageCacheMode,
PageCacheFrequence,
PageInheritID,
PageInheritUpdateDate,
(SELECT PageInheritStatus FROM page WHERE PageID = @idFrom),
PageApprovalType,
PageApprovalState,
PageVersionTimeStamp,
PageApprovalStep,
PageTopLevelIntegration,
PageForIntegration,
PageRotationType,
(SELECT PageMasterPageID FROM page WHERE PageID = @idFrom),
PageTopLogoImageAlt,
PageNeedTranslation,
PageNavigation_UseEcomGroups,
PageNavigationParentType,
PageNavigationGroupSelector,
PageNavigationMaxLevels,
PageNavigationProductPage,
PageNavigationShopSelector,
Navigation_UseEcomGroups,
NavigationParentType,
NavigationGroupSelector,
NavigationMaxLevels,
NavigationProductPage,
NavigationShopSelector,
PageUserManagementPermissions,
PageUrlName,
PageHidden,
PageIsTemplate,
PageTemplateDescription,
PageMetaTitle
FROM Page WHERE PageParentPageID = @idFrom )
END
GO
You must be logged in to post in the forum