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

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 06:21:33
Script start
Timing: Jan 31 2025 06:21:33
Module start 'layout'
Timing: Jan 31 2025 06:21:33
Module start 'content'
Timing: Jan 31 2025 06:21:33
Module end 'content'
Timing: Jan 31 2025 06:21:33
Script end

Main resources:

Total runtime0.0140 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.0058 588.1328151.2109
Module start 'layout' 0.00580.0024 739.343836.6484
Module start 'content' 0.00810.0047 775.992294.1406
Module end 'content' 0.01280.0011 870.132833.9922
Script end 0.0140  904.1250 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002417.0049140.0002
Check MTime0.00107.4742140.0001
Mysql Total
Database connection0.00118.082510.0011
Mysqli_queries0.002215.388030.0007
Looping result0.00000.071610.0000
Template Total0.00096.310.0009
Template load0.00074.809610.0007
Template processing0.00021.385110.0002
Override
Cache load0.00053.279710.0005
General
dbfile0.00021.766880.0000
String conversion0.00000.040940.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