The current version 1.2 has a problem.
It uses a variable $name which is unset after the routine..this unsets $name used in the contact us page to pre-populate the name field when a client is logged in.
I suggest this change from
toPHP Code:while (!$categories_ap->EOF) {
$id = $categories_ap->fields['categories_id'];
$name = $categories_ap->fields['categories_name'];
$add_content .= '<li><a href="' . zen_href_link(FILENAME_DEFAULT, '&cPath='.$id) . '">'.$name.'</a></li>' . "\n";
$categories_ap->MoveNext();
}
$add_content .= '</ul>';
//debug echo $add_content;
unset($name);
PHP Code:while (!$categories_ap->EOF) {
$categories_id = $categories_ap->fields['categories_id'];
$categories_name = $categories_ap->fields['categories_name'];
$add_content .= '<li><a href="' . zen_href_link(FILENAME_DEFAULT, '&cPath='.$categories_id) . '"><span class="catSpan">'.$categories_name.'</span></a></li>' . "\n";
$categories_ap->MoveNext();
}
$add_content .= '</ul>';
//echo $add_content;//debug to check query is ok
//unset($categories_name);//was $name but overwrote $name in contact_us
Steve
github.com/torvista: BackupMySQL, Structured Data, Multiple Copy-Move-Delete, Google reCaptcha, Image Checker, Spanish Language Pack and more...
Will this work with 1.5?
It probably will. The files and systems involved are not ones that changed for v1.5.x.
I've just noticed that the array that gets used for this produces an incomplete cPath.
ie if your parent id is 2 and the category is 345, the link goes to 345 instead of 2_345 which will result in incomplete breadcrumbs.
This is how I fixed it:
in \includes\modules\sideboxes\YOUR_TEMPLATE\separate_category_sidebox.php
change
toPHP Code:while (!$categories_ap->EOF) {
$id = $categories_ap->fields['categories_id'];
$name = $categories_ap->fields['categories_name'];
$add_content .= '<li><a href="' . zen_href_link(FILENAME_DEFAULT, '&cPath='.$id) . '">'.$name.'</a></li>' . "\n";
$categories_ap->MoveNext();
}
Note I have also changed the variable names for clarity and added a css class to the link.PHP Code:while (!$categories_ap->EOF) {
$categories_path = zen_get_path($categories_ap->fields['categories_id']);
$categories_name = $categories_ap->fields['categories_name'];
$add_content .= '<li><a href="' . zen_href_link(FILENAME_DEFAULT, '&'.$categories_path) . '"><span class="catSpan">'.$categories_name.'</span></a></li>' . "\n";
$categories_ap->MoveNext();
}
Steve
github.com/torvista: BackupMySQL, Structured Data, Multiple Copy-Move-Delete, Google reCaptcha, Image Checker, Spanish Language Pack and more...
I need to eat the previous post, the "fix" worked at the time but not later, this appears to work consistently:
PHP Code:while (!$categories_ap->EOF) {
$categories_path = zen_get_generated_category_path_rev($categories_ap->fields['categories_id']);//debug echo '$categories_path='.$categories_path.'<br />';
$categories_name = $categories_ap->fields['categories_name'];
$add_content .= '<li><a href="' . zen_href_link(FILENAME_DEFAULT, '&cPath='.$categories_path) . '"><span class="catSpan">'.$categories_name.'</span></a></li>' . "\n";
$categories_ap->MoveNext();
}
Steve
github.com/torvista: BackupMySQL, Structured Data, Multiple Copy-Move-Delete, Google reCaptcha, Image Checker, Spanish Language Pack and more...
Hello,
I'm building my site and I'm using this mod on my site, but the side-box looks very different to my other template side-box, can someone put me in the right direction to show the information like the other templates side-box.
Here is my siteThanksCode:http://compuservicesj.com/store/
Jose
Add to your stylesheetCode:.separatesideboxlist>li {margin-left: -3em; list-style: inside url(../images/bc_info.gif);line-height: 2.0em; border-bottom: 1px dashed #aabbcc;}
I have been using this mod for over a year and love it. I had 4 separate categories set up and working properly. I just added a new category and set it up as the others. I am only getting the heading no products under the heading. I can change the includes/modules/sideboxes/ mytemplate line for and c.parent_id = 20 to another category id and change the separate_category_sidebox_04.php to separate_category_sidebox_03.php, and evey thing works fine. Any help would keep what little hair I have.