Forums / Setup & design / using offset with nice urls

using offset with nice urls

Author Message

Ben Pirt

Tuesday 26 August 2003 2:24:48 am

Hi there,
My site is almost there now but there are a few questions remaining.
I have it set up to use nice urls which works fine, and in the news section I am trying to paginate with 5 stories per page. When not using nice urls, I can just stick an "/offset/5" etc on to the end of the url and all will work fine, providing I reference this in my fetch statement.

However, when I try this on a nice url, the site just takes me back to the fromt page. I'm sure this must be possible, I don't want to have to revert to 'ugly' urls when viewing subsequent pages (although I noticed this happens on the EZ forums :-)) I saw someone else asked this question, but there were no replies. Hopefully this isn't just impossible.

Any ideas?

Thanks for your help,

Ben Pirt

Jan Borsodi

Tuesday 26 August 2003 6:37:58 am

Sorry to say this but it's not supported yet. We haven't come up with a good solution to it yet, right now the url must match the stored (nice) url directly, the reason for this is speed.

--
Amos

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

Ben Pirt

Tuesday 26 August 2003 6:50:00 am

I see,
couldn't you use strip the offset before looking up the match in the DB, then make the offset variable available in the template? Or does that just not fit in to the structure you have (I haven't hacked around with EZs php yet)
Cheers,
Ben

Jan Borsodi

Tuesday 26 August 2003 6:56:27 am

If we do that we would have to assume that all urls to eZ publish will use offset/4 as used in content views. This could easily break custom made modules, it could also give problems to urls where offset is the name of an object.

The best way I can see at the moment is to add some special character before all parameters to the url, like
my/nice/url/_offset/20
however this makes the url a bit uglier.

Another way is to use the ? parameter on urls, like
my/nice/url/?offset=20
but then we are back to even uglier urls, which is what we originally tried to avoid.

--
Amos

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

Ben Pirt

Tuesday 26 August 2003 7:10:23 am

I think I would even prefer the

/my/nice/url/?offset=10

approach because it still makes sense regarding which section the user is in. So if they were in the news section at least
/news/?offset=10

would make more sense than
/content/view/full/xx/offset/10

because 'content/view/full' doesn't really relate to the section you are viewing other than in a behind the scenes kind of way, which is what we're trying to avoid.

All the best,
Ben

eZ debug

Timing: Jan 31 2025 04:25:53
Script start
Timing: Jan 31 2025 04:25:53
Module start 'content'
Timing: Jan 31 2025 04:25:53
Module end 'content'
Timing: Jan 31 2025 04:25:53
Script end

Main resources:

Total runtime0.1709 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.0048 587.9297180.8359
Module start 'content' 0.00480.0046 768.765697.8672
Module end 'content' 0.00940.1613 866.6328526.7734
Script end 0.1708  1,393.4063 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00301.7586200.0002
Check MTime0.00120.7068200.0001
Mysql Total
Database connection0.00060.355210.0006
Mysqli_queries0.117568.78501410.0008
Looping result0.00110.62451390.0000
Template Total0.161194.310.1611
Template load0.00060.360510.0006
Template processing0.160593.902710.1605
Override
Cache load0.00040.246210.0004
Sytem overhead
Fetch class attribute can translate value0.00090.518410.0009
XML
Image XML parsing0.00030.165610.0003
General
dbfile0.00442.5770200.0002
String conversion0.00000.002930.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