Offset navigator and URL

Author Message

Rebecca Denham

Friday 20 March 2009 2:16:37 am

We have a large multi-lingual site developed with eZ version 401 which includes forum topics and discussions. On the forum pages we display up to 50 discussions per page and then use the standard google navigator template for viewing subsequent pages. The URLs for the subsequent pages are displayed in the standard eZ format as ".../(offset)/50".

Is it possible to modify this URL format for the subsequent pages to display just the page number instead of the user parameter name/value pair? For example, if a forum discussion includes 3 pages, the google navigator would display pages "1 2 3" with the URLs formatted as ".../(offset)/50" and ".../(offset)/100" for pages 2 and 3 respectively. I would like the URLs to be formatted as ".../2" and ".../3" for pages 2 and 3 respectively.

Thanks in advance for any suggestions.

Jean-Yves Zinsou

Friday 20 March 2009 4:08:03 am

Hi there,
i don't know it this is possible in a simple way because the (offset) parameter in your url is used as view parameter in the template code to compute where to start the fetching of the nodes to list
;-(

The only way i can think of achieving this , is to make an extension with a module that takes the offset as ordered parameters ...

Is it worth it ?

Any other suggestion someone ?

Jey

Do Androids Dream of Electric Sheep?
I dream of eZpubliSheep....
------------------------------------------------------------------------
http://www.alma.fr

Benjamin Lorteau

Wednesday 01 July 2009 6:32:15 am

First of all you can change the way that offset is handled, by modifying the template to accept page numbers instead of offset number.

You would have to compute the offset passed in the fetch function, and modify navigator/google.tpl behavior to display page numbers instead of offsets in the generated links.

Then you could use Wilcards URL to transform something like

/Forum/Topic/(page)/2

into

/Forum/Topic/2

eZ Publish personal project : http://www.aeriesguard.com [fr]

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 04:18:19
Script start
Timing: Jan 31 2025 04:18:19
Module start 'layout'
Timing: Jan 31 2025 04:18:19
Module start 'content'
Timing: Jan 31 2025 04:18:19
Module end 'content'
Timing: Jan 31 2025 04:18:19
Script end

Main resources:

Total runtime0.0138 sec
Peak memory usage2,048.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0053 588.1250151.2109
Module start 'layout' 0.00530.0022 739.335936.6328
Module start 'content' 0.00760.0049 775.968890.2188
Module end 'content' 0.01240.0013 866.187533.9922
Script end 0.0138  900.1797 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002417.2021140.0002
Check MTime0.00118.0308140.0001
Mysql Total
Database connection0.00074.899310.0007
Mysqli_queries0.002316.749330.0008
Looping result0.00000.079510.0000
Template Total0.00107.110.0010
Template load0.00085.879210.0008
Template processing0.00021.168210.0002
Override
Cache load0.00064.472510.0006
General
dbfile0.00128.934680.0002
String conversion0.00000.058840.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