purkat:
The main reason for this is so I can add some custom content below the categories, so the page will look like:
[content from main_page in Define Pages Editor]
[categories list]
[New products for August]
[specials]
[custom content block added to template]
Hope that makes sense :) (I'm developing on local server so can't give URL).
purkat:
I only want [custom content] on the home page which means I need to add it to tpl_index_default.php. If I add it to tpl_index_categories.php [custom content] will show on category listings (although I discovered only on categories that have sub-categories for some reason).
So what I'm asking is - how do I include the code to display categories in tpl_index_default.php?
Some things are still not fully clear.
1. Zen Cart can be configured to show categories on the home page, or not.
2. If you choose to display categories on the home page, then tpl_index_default.php is ignored
The answers being given have been in keeping with the way Zen Cart works.
However, what you haven't stated clearly is whether you "require" that your home page "have" your categories shown on it (which is not the default, but is what Ajeh was mentioning at one point).
If you "must" have your categories listing show on the home page, then you need to enable the indicated switch.
Then if you must add custom content "only" when no category is selected, then you'll need to edit as follows:
/includes/templates/YOURTEMPLATE/templates/tpl_index_categories.php
at bottom of file, add:[PHP]<?php // display my custom content only on home page:
if (!($current_page!='index' || (int)$cPath>0 )) { ?>
<div><h2>My Custom Content Goes Here</h2></div>
<?php } ?>[/PHP]