How to make page navigation like google navigator?

Author Message

Daniele Nocentini

Thursday 09 July 2009 2:19:18 am

I have a db tables with many records and I want to make a page navigation for show limited number of records.
How can I use google navigator inside my php code of my extension?

thanks.

Antica Bottega Digitale srl
http://www.abd.it

Max Keil

Thursday 09 July 2009 3:52:40 am

Hi Daniele,

you can use view and UserParameters to realize your own google nav. Following example works within the Modules:

$Module = $Params['Module'];

$UserParameters=(isset($Params['UserParameters']))?$Params['UserParameters']:array();

$viewParameters = array( 'offset' => 0, 'limit' => 5 );
$viewParameters = array_merge( $viewParameters, $UserParameters );

$filter = array(
                    'ClassFilterType' => 'include',
                    'ClassFilterArray' => array( 'folder' ),
                    'Limit' => $viewParameters['limit'],
                    'Offset' => $viewParameters['offset']
              );
$folders = eZContentObjectTreeNode::subTreeByNodeID( $filter, 2 );

The view parameters will be set to $Params['UserParameters'] and you can merge em with you default values.

Mit freundlichen Grüßen
Best regards

Max Keil

____________________________________________________________
eZ Publish Gold Partner - http://www.all2e.com
http://ez.no/partners/worldwide_partners/all2e_gmbh

H-Works Agency

Wednesday 15 July 2009 3:27:10 am

A template "navigator/google.tpl" already exists in default ezp distrib.

EZP is Great

Max Keil

Wednesday 15 July 2009 3:38:34 am

I agree!

The code above shows how to support the google navigation within the PHP. You cannot use the googlenavigator template if your Module/View do not support it.

Mit freundlichen Grüßen
Best regards

Max Keil

____________________________________________________________
eZ Publish Gold Partner - http://www.all2e.com
http://ez.no/partners/worldwide_partners/all2e_gmbh

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 31 2025 01:35:26
Script start
Timing: Jan 31 2025 01:35:26
Module start 'layout'
Timing: Jan 31 2025 01:35:26
Module start 'content'
Timing: Jan 31 2025 01:35:26
Module end 'content'
Timing: Jan 31 2025 01:35:26
Script end

Main resources:

Total runtime0.0257 sec
Peak memory usage6,144.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0058 588.2656151.2266
Module start 'layout' 0.00580.0051 739.4922220.7344
Module start 'content' 0.01090.0130 960.22661,001.9609
Module end 'content' 0.02390.0018 1,962.187533.9922
Script end 0.0256  1,996.1797 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002810.9802140.0002
Check MTime0.00114.2164140.0001
Mysql Total
Database connection0.00072.890210.0007
Mysqli_queries0.003011.830930.0010
Looping result0.00000.085410.0000
Template Total0.00135.110.0013
Template load0.00103.794710.0010
Template processing0.00031.254710.0003
Override
Cache load0.00062.508510.0006
General
dbfile0.00031.021680.0000
String conversion0.00000.039040.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs