Search

When you add the pagination information into a DS, why does the value of current-page attribute default to empty quotes?

<pagination total-entries="2" total-pages="1" entries-per-page="10" current-page="" />

By default, you would be on page 1. I ran into an issue with this before in Firefox that returned NaN and I couldn't pinpoint it for a while. obviously, i eventually found out the issue and did a little check in my xsl for the current-page if it was empty or not. so my question is what was the reasoning defaulting to "" as opposed to 1?

It's a bug. If you try to set the default to 1 it doesn't save. The workaround is to do it manually in the DS file. I believe it's fixed in RC1. I posted somewhere about this before. Will try to dig it up.

ah ok. thanks czheng.

It must've been on IRC, I can't find it here or on the bugs site. For the record, though, what I have in my DS file is:

 Class datasourceyour_datasource extends Datasource {
 ...
 var $dsParamSTARTPAGE = '{$page:1}';

For some reason the admin chokes on {$page:1}, so until RC1 is released you need to do this manually in your DS files.

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details