Forums / Setup & design / How to get Next, Previous, and numbered page links

How to get Next, Previous, and numbered page links

Author Message

Eric Floehr

Monday 07 April 2003 7:56:57 am

Hi,

I have been playing with ezPublish, and the demo. Is there any example template code to get "Next", "Previous", and the numbered page links like appear at the bottom of this forum for example? I know it will have to do something with offset, but I can't get things to be generic enough to always work. Any pointers?

Thanks!
Eric

Jan Borsodi

Tuesday 08 April 2003 2:28:58 am

You can use the generic navigators which are shipped with eZ publish, they require some input variables and will automatically generate the required html.

For instance:
{include name=navigator
uri='design:navigator/google.tpl'
page_uri=concat('/content/view','/full/',$node.node_id)
item_count=$list_count
view_parameters=$view_parameters
item_limit=$page_limit}

uri: The template to include, you can also use simple.tpl. It can also be a good idea to look at these templates to so how it is done.
page_uri: The uri to the current page, the offset will be appended to this uri.
item_count: The maximum number of items the list contains
view_parameters: Parameters which are specific to views, contains for instance offset. Might be extended in the future.
item_limit: The maximum number of items on this page

--
Amos

Documentation: http://ez.no/ez_publish/documentation
FAQ: http://ez.no/ez_publish/documentation/faq

Eric Floehr

Wednesday 09 April 2003 11:13:27 am

Thank you! This is working great!

Jonathan Stubbs

Tuesday 15 April 2003 1:41:07 pm

Hi,

Its not clear where we are supposed to set the variables - in the google.tpl/simple.tpl page or in the view page?

For example - I would like to show 10 news stories on the first page. Can someone enlighten me?

Thanks!

Jan Borsodi

Wednesday 16 April 2003 1:16:56 am

You set it in the view. Just copy the template code shown earlier and try changing some parameters to understand how it works.

Here's an example with 10 items per page, a total of 56 items and the current offset is 20 (page 3).
{include name=navigator
uri='design:navigator/google.tpl'
page_uri=concat('/content/view','/full/',$node.node_id)
item_count=56
view_parameters=hash(offset,20)
item_limit=10}

Normally view_parameters is set to use the local $view_parameter variable which is supplied from the view code.

--
Amos

Documentation: http://ez.no/ez_publish/documentation
FAQ: http://ez.no/ez_publish/documentation/faq

di sho

Wednesday 14 May 2003 2:01:55 pm

when I click on links (1,2,3 ....)
htis error appears
"Unavailable
The object is not available."
on page ..../content/view/full/16/offset/5
/content/view/full/16 - works great
can you help me

my code:
{include name=navigator
uri='design:navigator/google.tpl'
page_uri=concat('/content/view','/full/',$node.node_id)
item_count=$list_count
view_parameters=hash(offset,0)
item_limit=5}

Thanks

Patrick ALLAERT

Saturday 08 October 2005 6:41:37 am

It seems there is a bug in the template simple.tpl, you have to change in the code "/offset/" to "/(offset)/"

Patrick ALLAERT
http://www.dixite.com/
http://users.pandora.be/patrick_allaert/

eZ debug

Timing: Jan 29 2025 23:52:23
Script start
Timing: Jan 29 2025 23:52:23
Module start 'content'
Timing: Jan 29 2025 23:52:23
Module end 'content'
Timing: Jan 29 2025 23:52:23
Script end

Main resources:

Total runtime0.1202 sec
Peak memory usage2,048.0000 KB
Database Queries141

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0057 588.0781180.8125
Module start 'content' 0.00570.0052 768.8906101.9297
Module end 'content' 0.01100.1092 870.8203530.2500
Script end 0.1202  1,401.0703 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00312.5700200.0002
Check MTime0.00131.0788200.0001
Mysql Total
Database connection0.00070.618810.0007
Mysqli_queries0.081968.11731410.0006
Looping result0.00090.75701390.0000
Template Total0.108890.510.1088
Template load0.00070.585510.0007
Template processing0.108189.923610.1081
Override
Cache load0.00050.420910.0005
Sytem overhead
Fetch class attribute can translate value0.00080.626910.0008
XML
Image XML parsing0.00020.196310.0002
General
dbfile0.00322.6453200.0002
String conversion0.00000.004830.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/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