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