Warning in Dev mode: Warning: Undefined array key "pageTitle"
Closed this issue · 2 comments
k-webdesign commented
Hey Kamil,
when browsing on a page with news categories I get this warning in the dev mode. nav_default wants to use pageTitle but this doesn't exist in the item array.
Contao 4.13.12, codefog/contao-news_categories 3.4.21
ErrorException:
Warning: Undefined array key "pageTitle"
at vendor/contao/core-bundle/src/Resources/contao/templates/navigation/nav_default.html5:7
at include('/Users/kim/develop/mamp/sysmove/vendor/contao/core-bundle/src/Resources/contao/templates/navigation/nav_default.html5')
(vendor/contao/core-bundle/src/Resources/contao/library/Contao/TemplateInheritance.php:108)
at Contao\Template->inherit()
(vendor/contao/core-bundle/src/Resources/contao/library/Contao/Template.php:295)
at Contao\Template->parse()
(vendor/contao/core-bundle/src/Resources/contao/classes/FrontendTemplate.php:43)
at Contao\FrontendTemplate->parse()
(vendor/codefog/contao-news_categories/src/FrontendModule/NewsCategoriesModule.php:133)
at Codefog\NewsCategoriesBundle\FrontendModule\NewsCategoriesModule->renderNewsCategories(1, array(2, 1, 5, 3))
(vendor/codefog/contao-news_categories/src/FrontendModule/NewsCategoriesModule.php:64)
at Codefog\NewsCategoriesBundle\FrontendModule\NewsCategoriesModule->compile()
(vendor/contao/core-bundle/src/Resources/contao/modules/Module.php:214)
at Contao\Module->generate()
(vendor/codefog/contao-news_categories/src/FrontendModule/NewsModule.php:84)
at Codefog\NewsCategoriesBundle\FrontendModule\NewsModule->generate()
(vendor/contao/core-bundle/src/Resources/contao/elements/ContentModule.php:98)
at Contao\ContentModule->generate()
(vendor/contao/core-bundle/src/Resources/contao/library/Contao/Controller.php:615)
at Contao\Controller::getContentElement(object(ContentModel), 'main')
(vendor/contao/core-bundle/src/Resources/contao/modules/ModuleArticle.php:197)
at Contao\ModuleArticle->compile()
(vendor/contao/core-bundle/src/Resources/contao/modules/Module.php:214)
at Contao\Module->generate()
(vendor/contao/core-bundle/src/Resources/contao/modules/ModuleArticle.php:70)
at Contao\ModuleArticle->generate(false)
(vendor/contao/core-bundle/src/Resources/contao/library/Contao/Controller.php:543)
at Contao\Controller::getArticle(object(ArticleModel), false, false, 'main')
(vendor/contao/core-bundle/src/Resources/contao/library/Contao/Controller.php:385)
at Contao\Controller::getFrontendModule('0', 'main')
(vendor/contao/core-bundle/src/Resources/contao/pages/PageRegular.php:190)
at Contao\PageRegular->prepare(object(PageModel))
(vendor/contao/core-bundle/src/Resources/contao/pages/PageRegular.php:60)
at Contao\PageRegular->getResponse(object(PageModel), true)
(vendor/contao/core-bundle/src/Resources/contao/controllers/FrontendIndex.php:320)
at Contao\FrontendIndex->renderPage(object(PageModel))
(vendor/symfony/http-kernel/HttpKernel.php:153)
at Symfony\Component\HttpKernel\HttpKernel->handleRaw(object(Request), 1)
(vendor/symfony/http-kernel/HttpKernel.php:75)
at Symfony\Component\HttpKernel\HttpKernel->handle(object(Request), 1, true)
(vendor/symfony/http-kernel/Kernel.php:202)
at Symfony\Component\HttpKernel\Kernel->handle(object(Request))
(public/index.php:44)
fritzmg commented
You are using the nav_default
template instead of the provided nav_newscategories
template. You need to select the latter for your news categories module.
k-webdesign commented
Thanks! In Contao 3.5 it still worked with a nav_default