I have an extension that conditionally loads the default nav menu, at /app/design/frontend/base/default/template/catalog/navigation/top.phtml
. However, I am in the default magento rwd/default
theme, and the base nav menu is not loading properly with the reference call. The extension calls: type="catalog/navigation" template="catalog/navigation/top.phtml"
. How would I adjust this call so that it properly loads the template at /base/default/template/catalog/navigation/top.phtml
.
-
Does 'top.phtml exist in 'rwd/default/...'? If try delete or rename it– MagePal ExtensionsJan 28, 2015 at 19:47
-
Your question makes no sense :D or I'm not reading it correctly– Lord SkeletorJan 28, 2015 at 19:53
2 Answers
If you are trying to load the file catalog/navigation/top.phtml
and there are two files:
base/default/template/catalog/navigation/top.phtml
rwd/default/template/catalog/navigation/top.phtml
It will pick #2 first. Only if it does not find a file there will it try and use the base/default
template.
If you want to make sure your template is used, you have some options:
- Remove that block reference in your module's layout xml and replace it with a new reference that uses a different template path, possibly
my_module/navigation/top.phtml
(located at pathbase/default/template/my_module/navigation/top.phtml
). - Remove that block reference as above, and replace with a new block type (or a rewritten block, but I generally choose the former) that you create (which might extend from the original block class). You can keep the same template path and instead alter what the methods called in the template return. Only really useful if you don't need to change markup, only data values (unless the markup is generated in methods instead of the template file)
The first option is probably the most common, as this gives you more control over what the template contains.
this should be useful for you, http://www.magentocommerce.com/knowledge-base/entry/magentos-theme-hierarchy
1) Look for requested file in: app/design/frontend/custom_package/custom_theme/ skin/frontend/custom_ package/custom_theme
2) If not found, look for requested file in: app/design/frontend/custom_package/default skin/frontend/custom_package/default
3) If not found, look for requested file in: app/design/frontend/base/default skin/frontend/base/default
4) If not found, a rendering error will occur.