how to display list filter data

arie

Member
Hi,

i'd like to know how to display the active filters datas (ie: selected label dropdown options) when the list is filtered please?

I used
Code:
var_dump($_POST);
but that displays only the id's and not the labels

thks
 
Hi Arie

I'm not sure what specific bits of data you need but this is the array that is assigned to the view:

Code:
var_dump($this->filters);

otherwise (not tested this but...) this might give more information:

Code:
$model = $this->getModel();
var_dump($model->getFilterArray());
 
What I'd like to achieve is to display, when a pdf export is ran on the top of the list, the active filters (selected options).

ie:
List title / Filters : filter 1 selected option 1 - filter 1 selected option 3

but the problem with
Code:
$model = $this->getModel();
var_dump($model->getFilterArray());
I can only get the selected option value and not the selected text
 
Hi,

what I'd like to achieve is to print on the pdf list export, the active filters ie:

Filters: filter 1 selected option text - filter 2 selected option text - ...

By using
Code:
$model = $this->getModel();
var_dump($model->getFilterArray());
I can only get the selected option value and not the selected option text.

Cheers
 
Hi,

what I'd like to achieve is to print on the pdf list export, the active filters ie:

Filters: filter 1 selected option text - filter 2 selected option text - ...

By using
Code:
$model = $this->getModel();
var_dump($model->getFilterArray());
I can only get the selected option value and not the selected option text.


Cheers
 
hi Arie
hi Arie
hi Arie ;)
There's no variable with access to that I'm afraid.
Could you not instead, create a custom PDF template, to style the filters to look like text instead of inputs?
 
You mean, create a custom list template and alter default_filter.php? the pb with that is how to alter
Code:
$filter->element;
witch is already an html input variable?

or perhaps, you may suggest something else?

I will try this solution but i have an problem:
when the list is filtered, the pdf template defined as the template is superseded by the user list template => so the pdf template is only used when the list isn't filtered.
do you have this issue as well?
 
when the list is filtered, the pdf template defined as the template is superseded by the user list template
I can't see this. PDF is showing filtered data in PDF template.

But components\com_fabrik\views\list\view.pdf.php is clearing the filter array
$this->filters = array();

So you have to modify view.pdf.php if you want to access $this->filters in the PDF template.

I think you can style $filter->element; with some css.
 
What I meant is when i make an export of a list, the pdf template defined in the backend list options (default in the attachment) is correctly used as the output => the pdf is rendered ok.
However, when I apply some filter on the list, the pdf template defined in the backend list options (default in the attachment) isn't correctly used and the pdf is rendered using the front-end template (jsn in the attachment).
 

Attachments

  • pdf_tpl.png
    pdf_tpl.png
    71.3 KB · Views: 387
Which exact Fabrik version are you running?
I can't see this on my site (recent GitHub version). PDF output is rendered with the defined PDF template no matter if list is filtered or not (frontend and backend).
 
I would suggest to backup and update (latest offical release is 3.0.9, if you've once updated from GitHub you must update from GitHub again).
 
Does it possible to print the filter table on the PDF? Instead accessing $this->filter?
If yes, could you suggest how Please?
 
Did you try what Troster suggested edit view.pdf.php and replace:


Code:
$this->filters = array();
$this->assign('showFilters', false);

Code:
$this->filters = $model->getFilters('listform_' . $this->renderContext);
$this->assign('showFilters', true);
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top