Forum OpenACS Q&A: multiple ad_table on a page

Collapse
Posted by Ben Chan on
Is there any way to put multiple ad_tables onto a page?

Right now, the default ordering variable is $orderby, but I want to have 2 different sortable tables which may have the same column name.

Is it possible to set one table to $orderby_1 while the other table sorts according to $orderby_2?

Was also wondering if there's a way to append "#table_location" to the end of the table header links such that it will jump to the location of the anchor tag (where the  table is)?  Tsuffix appends the #table_location plus the orderby string.

Thanks for any help!

Collapse
Posted by Jade Rubick on
Hi Ben,

I know this isn't what you're asking, but have you considering using list-builder? It's fairly easy to learn, and I like it much better than ad_table. It also allows several tables on the same page.

Collapse
Posted by Ben Chan on
Actually, I haven't heard of it before.  I'll go take a look at it and see if it does what I need!

Thanks for your suggestion!

Collapse
Posted by Jade Rubick on
Try http://rubick.com:8002/openacs/list-builder to start. And there is a lot of sample code throughout OpenACS. Grep for it.
Collapse
Posted by Jun Yamog on
I would recommend list builder too.  But currently there is some limitation regarding multiple list builder in a single page.  Look at the thread below.

https://openacs.org/forums/message-view?message_id=173963

Collapse
Posted by Andrew Piskorski on
Ben, to answer your original question, yes, it is entirely possible to put multiple ad_tables on a page, in fact it is easy. I don't have a good example handy but I've done it many times in the past...