Customising multiple category layout to display filtered item

More
6 years 7 months ago #69175 by ggppdk
Hello

that is a different question,

my answer is that if a field implements filtered
- then you can have filter multi-category views using the parameter i mentioned above

so does your field implement filtering ?

- is you field or "file" field
- or you have written a new custom field type


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star...

Please Log in or Create an account to join the conversation.

More
6 years 7 months ago - 6 years 7 months ago #69176 by Ali_wdm
I have written a new custom field type plugin. I want to hide some items from category layout on the basis of username which is stored in table.
Last edit: 6 years 7 months ago by Ali_wdm.

Please Log in or Create an account to join the conversation.

More
6 years 7 months ago #69184 by ggppdk
Hello

you only need to know what you field stores in the DB as value
and then you can use the locked filter values feature

do you know what is the field value that your fields stores in the DB ?


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star...

Please Log in or Create an account to join the conversation.

More
6 years 7 months ago #69194 by Ali_wdm
There is one table which stores data of CSV file. Structure of this table is (id, itemId, username, data).
How do I write sql query to fetch username from this table...??

Please Log in or Create an account to join the conversation.

More
6 years 7 months ago #69195 by ggppdk
Hello

is you custom field type able to display a filter ?
i mean does your custom code in your plugin implement the method:

onDisplayFiltered() // this is for category view
onDisplayFilteredSearch() // this is for search view

but the above is optional if you will never display the filter, but this is required:
getFiltered() // this is for category view
getFilteredSearch() // this is for search view

these 2 methods , normally look at our flexicontent values table
but you can make them look at your table and return the FLEXIcontent item IDs that are a match
- just you need to decide what is the value of the filter ? is it a number ?
some text what ?

the you can enter this value in the parameter "Locked filter values" and then your methods
getFiltered() // this is for category view
getFilteredSearch() // this is for search view

will return the matching item IDs
Code:
// Method to get the active filter result (an array of item ids matching field filter, or subquery returning item ids) // This is for content lists e.g. category view, and not for search view function getFiltered(&$filter, $value, $return_sql=true) { // do some work $item_ids = array(); // if (!is_numeric($value)) $ids[] = 51; elseif ($value < 0 ) { $ids[] = 4; $ids[] = 5; } elseif ($value == 0 ) $ids[] = 7; else $ids[] = 11; if ($value == 'test') $ids[] = 113; else // Do some sql query and add more // Make sure we only have integer JArrayHelper::toInteger($ids); return $return_sql ? ' AND i.id IN (' . implode(',' , $ids) . ') ' : $ids; }


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star...
The following user(s) said Thank You: Ali_wdm

Please Log in or Create an account to join the conversation.

More
6 years 7 months ago - 6 years 7 months ago #69277 by Ali_wdm
Last edit: 6 years 7 months ago by Ali_wdm.

Please Log in or Create an account to join the conversation.

Moderators: vistamediajoomlacornerggppdk
Time to create page: 0.806 seconds
Save
Cookies user preferences
We use cookies to ensure you to get the best experience on our website. If you decline the use of cookies, this website may not function as expected.
Accept all
Decline all
Essential
These cookies are needed to make the website work correctly. You can not disable them.
Display
Accept
Analytics
Tools used to analyze the data to measure the effectiveness of a website and to understand how it works.
Google Analytics
Accept
Decline