BREADCRUMB without hidden submenues

Post custom hacks and enhancements for phpwcms here only. Maybe some of these things will be included in official release later.
Post Reply
haiopei
Posts: 2
Joined: Thu 26. Feb 2004, 12:47

BREADCRUMB without hidden submenues

Post by haiopei »

Hi!!

I needed a breadcrumb without the hidden submenues.
The following topic describes the problem:
http://www.phpwcms.de/forum/viewtopic.p ... breadcrumb

Solution:
In phpwcms/include/inc_front/front.func.inc.php change the code as following:

Original:
--------------------------------------------------------
function breadcrumb ($start_id, $struct_array, $end_id, $link_to="index.php", $spacer=" > ") {
...
while ($start_id) { //get the breadcrumb path starting with given start_id
$data[$start_id] = $struct_array[$start_id]["acat_name"];
$start_id = $struct_array[$start_id]["acat_struct"];
if($end_id && $start_id == $end_id) break;
}
$data[$start_id] = $struct_array[$start_id]["acat_name"];
$crumbs_part = array_reverse($data, 1);
...
--------------------------------------------------------
Changed:
--------------------------------------------------------
function breadcrumb ($start_id, $struct_array, $end_id, $link_to="index.php", $spacer=" > ") {
...
while ($start_id) { //get the breadcrumb path starting with given start_id
if(!$struct_array[$start_id]["acat_hidden"]) // check for hidden flag
$data[$start_id] = $struct_array[$start_id]["acat_name"];
$start_id = $struct_array[$start_id]["acat_struct"];
if($end_id && $start_id == $end_id) break;
}
if(!$struct_array[$start_id]["acat_hidden"]) // check for hidden flag
$data[$start_id] = $struct_array[$start_id]["acat_name"];
$crumbs_part = array_reverse($data, 1);
...
--------------------------------------------------------


Have fun! :D
Moozie
Posts: 164
Joined: Sat 8. Nov 2003, 00:21
Location: Netherlands

Post by Moozie »

Maybe this hack is also suitable for the search-function. Now it also search throught hidden pages and shows them in the found-list. So it's not a hidden page anymore...
Post Reply