Hi,
I don't know if this might be of interest for someone, or even be
integrated into the core at some point, but I created a hooks
for BOLTFbreadcrumb and BOLTsearchPageList, allowing you the following
things:
- add an argument limit to breadcrumb, in order to display only N items
(+ the final one if there are more than N page levels)
- add argument final (by default "...") to breadcrumb that tells what
should be placed between seperators instead of the "hidden" levels, thus
between item N and N+1 if there is a N+1 (as you can see in attached
picture, where limit is 3)
- add the possibility to search for group=page.+ (or group=page+, or
group=page.+.+.+) in addition to group=page.*, in order to be able to limit
the number of levels we want to search for, without having to use patterns
How to do it? For each method, just copy-paste current code into a hook and
apply following patches to the hook methods:
- BOLTFbreadcrumb (file functions.php)
- between lines 29 and 30, add:
- $lastseparator = $separator.BOLTinit('...',
$args['final']).$separator;
- between old lines 48 and 49 - therefore between new lines 49 and 50
-, add:
- $outlast = '';
if ((isset($args['limit'])) && ((isset($args['offset'])) &&
(($args['limit']+$args['offset']) <= $last) || ($args['limit'] <=
$last))) {
if (isset($out[$last])){
if((isset($args['offset'])) && (($args['limit']+$args['offset'])
== $last) || ($args['limit'] == $last)) $lastseparator=$separator;
$outlast = $out[$last];
unset($out[$last]);
}
}
- between old lines 49 and 50 - therefore between new lines 58 and 59
- , add:
- if (isset($args['limit'])) $out = array_slice($out, 0,
$args['limit']);
- before the return, add:
- if($outlast != '') $out = $out.$lastseparator.$outlast;
- BOLTsearchPageList (file library.php)
- replace line 1634 by:
- if (strpos($p, "*") !== false || strpos($p, "+") !== false) {
- between lines 1638 and 1639, add:
- $p = str_replace('+', "[$namespat]*", $p);
That's it!
That's not really a recipe, nor a plugin, so I didn't know where to put it
in the website documentation...
Regards,
Tiffany
--
You received this message because you are subscribed to the Google Groups
"BoltWire" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/boltwire.
For more options, visit https://groups.google.com/d/optout.