[albatross-users] Trying to work around pagnation with cols issue...

Michael C. Neel neel at mediapulse.com
Mon Jun 23 08:51:22 EST 2003


Currently Albatross doesn't support pagesize and cols in the same al-for
tag, and I'm trying towork around this by grouping my results into cols
and using two al-for tags for the output.  It's not working, and I'm not
sure why.

Here is the page_process for the section I'm testing with:

            photos =
['One','Two','Three','Four','Five','Six','Seven','Eight','Nine']
            ctx.locals.photos = []
            # We now must make ctx.locals.photos be a list of (up to) 3
element lists of photos
            # this is because albatross doesnot support pagnation with a
cols attrib
            temp = []
            for pht in photos:
                temp.append(pht)
                if len(temp) == 3:
                    ctx.locals.photos.append(temp[:]) # [:] is an
explict copy
                    temp = []
            if len(temp):
                ctx.locals.photos.append(temp[:]) # [:] is an explict
copy

And then in my template file:

      <table>
        <al-for expr="photos" iter="row" pagesize="2">
        <tr>
          <al-for expr="row.value()" iter="cell">
          <al-exec expr="pht = cell.value()">
          <td align="center"><al-value expr='pht' noescape>
          </td>
          </al-for>
        </tr>
        </al-for>
      </table>
      <table>
        <tr>
            <al-form method="POST">
            <td>
            <al-if expr="row.has_prevpage()">
              <al-input type="submit" prevpage="row" value="<<"
name="photo_prev">
             </al-if>
            </td><td align="right">
             <al-if expr="row.has_nextpage()">
              <al-input type="submit" nextpage="row" value=">>"
name="photo_next">
             </al-if>
            </td>
            </al-form>
        </tr>
      </table>

The next button does appear, but clicking it doesn't advance to the next
page.

Thanks in advance,
Mike



More information about the Albatross-users mailing list