{"record":{"id":"bd206e4a59e93fdf","repo":"octobercms/october","slug":"cms-lang-partial-not-found-name","errorCode":null,"errorMessage":"cms::lang.partial.not_found_name","messagePattern":"cms::lang\\.partial\\.not_found_name","errorType":"exception","errorClass":"CmsException","httpStatus":null,"severity":"error","filePath":"modules/cms/classes/controller/HasRenderers.php","lineNumber":180,"sourceCode":"         *     });\n         *\n         * Or\n         *\n         *     $controller->bindEvent('page.beforeRenderPartial', function ((string) $partialName) {\n         *         return Cms\\Classes\\Partial::loadCached($theme, 'custom-partial-name');\n         *     });\n         *\n         */\n        if ($event = $this->fireSystemEvent('cms.page.beforeRenderPartial', [$name])) {\n            $partial = $event;\n        }\n        else {\n            $partial = $this->loadPartialObject($name, $throwException);\n        }\n\n        if ($partial === false) {\n            if ($throwException) {\n                throw new CmsException(Lang::get('cms::lang.partial.not_found_name', ['name'=>$name]));\n            }\n            else {\n                return false;\n            }\n        }\n\n        // Run functions for CMS partials only (Cms\\Classes\\Partial)\n        if ($partial instanceof Partial) {\n            if (!$this->partialStack) {\n                $this->partialStack = new PartialStack;\n            }\n            $this->partialStack->stackPartial();\n\n            foreach ($partial->settings['components'] as $component => $properties) {\n                // Do not inject the viewBag component to the environment.\n                // Not sure if they're needed there by the requirements,\n                // but there were problems with array-typed properties used by Static Pages\n                // snippets and parseRouteParamsOnComponent(). --ab","sourceCodeStart":162,"sourceCodeEnd":198,"githubUrl":"https://github.com/octobercms/october/blob/b608633a7e8922487d91a8161499020121c3b3bf/modules/cms/classes/controller/HasRenderers.php#L162-L198","documentation":"renderPartial() (backing the {% partial %} tag) could not find the named partial in the current theme — neither from a cms.page.beforeRenderPartial event override nor from the theme datasource — and was invoked with $throwException = true, the default for the Twig tag.","triggerScenarios":"{% partial 'cards/price' %} or $this->renderPartial('cards/price') when themes/<activeTheme>/partials/cards/price.htm does not exist; renamed subfolders; casing mismatch; the active theme switched so the partial is absent.","commonSituations":"Refactoring partial folders without updating references; developing on case-insensitive macOS/Windows and deploying to Linux; referencing partials belonging to another theme; database-layer templates missing the file copy.","solutions":["Create themes/<activeTheme>/partials/<name>.htm or correct the reference path","Check letter casing exactly — partial names are case-sensitive on Linux","Confirm Theme::getActiveThemeCode() points at the theme that actually contains the partial","For optional partials, call renderPartial($name, [], false) and handle the false return instead of letting it throw"],"exampleFix":"{# before #}\n{% partial 'price_card' %}\n\n{# after #}\n{% partial 'cards/price' %}","handlingStrategy":"validation","validationCode":"$theme = \\Cms\\Classes\\Theme::getActiveTheme();\nif (!\\Cms\\Classes\\Partial::load($theme, 'cards/price')) {\n    // partial missing: skip the block, use a fallback partial, or fail with context\n}","typeGuard":null,"tryCatchPattern":"try { echo $this->renderPartial('cards/price'); } catch (\\Cms\\Classes\\CmsException $e) { echo '<!-- partial missing -->'; }","preventionTips":["Use exact-case paths matching the filesystem, including subfolders","Run a reference check (grep) for every partial name before renaming or moving it","Develop on a case-sensitive filesystem or enable case-sensitivity checks in CI"],"tags":["partials","cms","template","theme","twig"],"backgroundTag":"template-not-found","analyzedSha":"b608633a7e8922487d91a8161499020121c3b3bf","analyzedAt":"2026-08-21T04:24:57.515Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}