Contao\ModuleSitemap::compile PHP Method

compile() protected method

Generate the module
protected compile ( )
    protected function compile()
    {
        /** @var PageModel $objPage */
        global $objPage;
        $lang = null;
        $host = null;
        // Start from the website root if there is no reference page
        if (!$this->rootPage) {
            $this->rootPage = $objPage->rootId;
        } else {
            $objRootPage = \PageModel::findWithDetails($this->rootPage);
            // Set the language
            if (\Config::get('addLanguageToUrl') && $objRootPage->rootLanguage != $objPage->rootLanguage) {
                $lang = $objRootPage->rootLanguage;
            }
            // Set the domain
            if ($objRootPage->rootId != $objPage->rootId && $objRootPage->domain != '' && $objRootPage->domain != $objPage->domain) {
                $host = $objRootPage->domain;
            }
        }
        $this->showLevel = 0;
        $this->hardLimit = false;
        $this->levelOffset = 0;
        $this->Template->items = $this->renderNavigation($this->rootPage, 1, $host, $lang);
    }
ModuleSitemap