Twitter
Thu
25
Jun
'09
PDF
Print
Send
 
Hits (2217) | Comments (5) | Favorited (5) | Votes (0)

First please copy filter template to start editing. This will prevent missing changes on update. Better to copy modern template as it have filters as checkboxes, instead of select list.

You will find new template files in components/com_resource/views/list/default_filters_yourname.php

You can do any changes to template but I'll explain how to create custom filters template. Custom means you display filters not in FOREACH cycle but place it manually. For that purpuse we pass $this->ifilters and $this->ifilters_ext to the template.

$this->ifilter is an array contain all field filters. I mean fields that you set to be filters. The field title is a index of array. For example $this->ifilters['Year']. Byt value also array with 2 indexes.

$year =  $this->ifilters['Year'];
$year_values = $year['values'];
$year_filter = $year['filter'];

Where  $year['values']; is an array of values of the filter. You may create list of checkboxes or select list or radio list with this array. $year['filter']; contain object of this filter. You can do var_dump($year['filter']) to see what is in it.

The $this->ifilters_ext object is differ. This is allso array and alsoname of the filter created in Fiters section in backend is an index of the array. Like $this->ifilters_ext['Age']. But value of array is object. The thing you need in it is result property

$age = $this->ifilters_ext['Age'];
echo JText::_('Age Between'). ': '.$age->result;

or

echo JText::_('Age Between'). ': '.$this->ifilters_ext['Age']->result;

This will help you to plase filters in whatever order you want and in whereever you want.

Do not forget you can add to template xmml file and on template edit save template properties. To get access to parameters in template use

$this->params->get('param_name')

Please note you should give uniquie names to your params as those params loaded to general param array and may overwrite somthing.


Comments
yuumbaalamAvatar
Quote
- -
Written by yuumbaalam VIP on 19 July 2010

Sounds really clear to me, but when I try to load them, I do not get anything, always "NULL", for example the Filter created in backend as a filter is easier to understand(as far as I can say), but no filter is shown, I have tried also with the id of the filter but no result.

Don´t really know where the problem is...

 

Here is how i call the filters with my own name:

echo $this->ifilters_ext['Nationality']->result;

But don´t really get something....Thanks, if I can manage this I wil be very thankful...

-
SerhioAvatar
Quote
- -
Written by Serhio STAFF on 19 July 2010

If you use resources 1.5 then you need use this

echo $this->ifilters_ext[23]->result;

You need to change title of the field to ID.

-
yuumbaalamAvatar
Quote
- -
Written by yuumbaalam VIP on 20 July 2010

I use 1.4...

-
SerhioAvatar
Quote
- -
Written by Serhio STAFF on 21 July 2010

Then may be filter ais not set for this category. Do you see this filter if you use standard method of display?

-
avatar
Quote
- -
Written by Eduardo Rivero on 21 July 2010

Yes, if you mean the foreach, yes, I really got no clue why I can't, I would guess it's like calling the fields with $this->ifields..... which I have used without any problem, but can't with filters...

Thanks fot the help!

-
Add New Comment
Name:
Email:
Comment:
Attachment
Hide Comment
Security code:
Enter text as you see on image
 
 
What is best way for Download/Installation MightyExtensions?
 


Member Area



Member Activity

We have 1992 guests and 7 members online


MightyTemplate - Professional Joomla Templates