[Dependencies] ... [Add module initialization to App_Doc_Site] protected function _beforeDisplay() { ... $this->_initSideBlockContent(); ... } protected function _initSideBlockContent() { if (class_exists('App_SideBlock_View') && 'n' == $this->getOption('system')) { $view = new App_SideBlock_View(); $view->setDoc($this); $view->exec(); } return $this; } [sitemap.xml] [Database changes] CREATE TABLE IF NOT EXISTS `qs_SideBlock` ( `id` int(11) NOT NULL AUTO_INCREMENT, `title` varchar(255) NOT NULL DEFAULT '', `content` text NOT NULL, `blockType` varchar(50) NOT NULL DEFAULT 'html', `pageType` enum('all','custom') NOT NULL DEFAULT 'custom', `linkType` enum('none','page','url') NOT NULL DEFAULT 'none', `linkPageId` int(11) NOT NULL DEFAULT '0', `linkTitle` varchar(255) NOT NULL DEFAULT '', `linkUrl` varchar(255) NOT NULL DEFAULT '', `show` enum('y','n') NOT NULL DEFAULT 'y', `added` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', `changed` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', PRIMARY KEY (`id`), KEY `show` (`show`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=17 ; CREATE TABLE IF NOT EXISTS `qs_SideBlock2Page` ( `idSideBlock` int(11) NOT NULL DEFAULT '0', `idPage` int(11) NOT NULL DEFAULT '0', `auto` enum('y','n') NOT NULL DEFAULT 'n', `sorter` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`idSideBlock`,`idPage`,`auto`), KEY `idRightBlock` (`idSideBlock`), KEY `idPage` (`idPage`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; [SQL for removing broken links] DELETE `SideBlock2Page` FROM `qs_SideBlock2Page` AS `SideBlock2Page` LEFT JOIN `qs_SideBlock` AS `SideBlock` ON `SideBlock`.`id` = `SideBlock2Page`.`idSideBlock` LEFT JOIN `qs_Page` AS `Page` ON `Page`.`id` = `SideBlock2Page`.`idPage` WHERE `SideBlock`.`id` IS NULL OR `Page`.`id` IS NULL;