Forums / General / Offset navigator and URL

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]

eZ debug

Timing: Jan 18 2025 16:08:20
Script start
Timing: Jan 18 2025 16:08:20
Module start 'content'
Timing: Jan 18 2025 16:08:21
Module end 'content'
Timing: Jan 18 2025 16:08:21
Script end

Main resources:

Total runtime0.7339 sec
Peak memory usage4,096.0000 KB
Database Queries196

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0058 587.6875180.8438
Module start 'content' 0.00590.5944 768.5313578.0078
Module end 'content' 0.60030.1335 1,346.5391332.7734
Script end 0.7338  1,679.3125 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00370.5047210.0002
Check MTime0.00140.1907210.0001
Mysql Total
Database connection0.00070.098810.0007
Mysqli_queries0.664890.58241960.0034
Looping result0.00240.32381940.0000
Template Total0.705996.220.3530
Template load0.00210.283320.0010
Template processing0.703895.908720.3519
Template load and register function0.00010.020010.0001
states
state_id_array0.00090.126310.0009
state_identifier_array0.00110.146620.0005
Override
Cache load0.00170.2342230.0001
Sytem overhead
Fetch class attribute can translate value0.00130.172940.0003
Fetch class attribute name0.00190.262250.0004
XML
Image XML parsing0.00150.203640.0004
class_abstraction
Instantiating content class attribute0.00000.001750.0000
General
dbfile0.00350.4824330.0001
String conversion0.00000.000530.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
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
3content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
4content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
2content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
2content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 14
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs