Jump to content

Lister - Session bookmarks for runtime drill-down


MarkE
 Share

Recommended Posts

Context: I have a (html) table of financial data in a back-end dashboard. Each element of the table is the sum of values from certain pages (for which a selector has been constructed).

What I want to do is add a link for each element to a lister page showing the pages that go to make up the element. i.e. a link to a lister page which uses the constructed selector. This sounds like it ought to be easy, but I've been chasing around for a while now and can't seem to crack it.

What I've tried:

  • supply a GET var with a csv of the required page ids - /?open=1,2,3 - this seems to have no effect;
  • use ProcessPageLister::addSessionBookmark() - I can't find much documentation about this, particularly regarding the format of the $bookmark array to be supplied. I tried the array structure I inferred from the code, viz: ['id' => , 'title' => , 'desc' => , 'selector' => , 'columns' => , 'sort' => , 'share' => ] but the selector seems not to be recognised (all pages are selected);
  • use a session var to communicate the selector to a hook before ProcessPageLister::renderResults - at least with this, the selector gets recognised, but it will be messy to operate because multiple selectors would be required to handle all the table elements (or some js would need to be added to see which one was clicked)

I really feel it ought to be easier than this and that I'm missing something obvious. Can anyone shed some light please?

Link to comment
Share on other sites

On 5/1/2020 at 8:29 PM, Martijn Geerts said:

I have build a Module for this some years ago

That's the idea. However, I have decided to use  ProcessPageLister::addSessionBookmark() now I've got it working, as it doesn't suffer from the problem of altering the default filters. All works fine now and I have a lovely drill-down effect ? 

EDIT - actually the default lister settings are still affected ? 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...