Hi All,
I need to manually add an external link to the main menu of 300+ sites.
I looked into the add page functionality and noticed it uses the stored procedure mp_pages_insert
So i coded a cursor to cycle through every site and add a page using this stored procedure.
The record gets added to the database, but the page doesnt show up on the site! very confused! any ideas how to fix?
DECLARE @PageGUID uniqueidentifier
DECLARE @ParentGUID uniqueidentifier
DECLARE @SiteGUID uniqueidentifier
DECLARE @SiteID int
DECLARE db_cursor CURSOR FOR
SELECT SiteID FROM mp_Sites
OPEN db_cursor
FETCH NEXT FROM db_cursor INTO @SiteID
WHILE @@FETCH_STATUS = 0
BEGIN
SELECT @SiteGUID = Siteguid FROM mp_sites WHERE SiteID = @SiteID
SELECT @PageGUID = NEWID()
SELECT @ParentGUID = PageGUID FROM mp_Pages WHERE SiteID = @SiteID and PageName = 'Home'
EXEC mp_pages_insert @SiteID, '-1', 'Shop', '20', 'All Users;', 'Content Publishers;', 'Content Publishers;', '', '',
0, 0, 0, '', '', '', '', 1, 'http://www.seacadetshop.org/', 0,0, 0, '', 1, '', 'Shop', 0, 'Daily', 0, '2012-09-07 10:23:19.050',
/* Page Guid */
@PageGUID,
/*Parent Guid */
@ParentGUID, 0,
/*Site GUID */
@SiteGUID,
'', '2012-09-07 10:23:19.050', 0, 1, 0, 0, '', 0,0,0,0, '00000000-0000-0000-0000-000000000000',
'', '', 0
FETCH NEXT FROM db_cursor INTO @SiteID
END
CLOSE db_cursor
DEALLOCATE db_cursor