Insert Filtered Post into an Article

peterk900

Member
I've copied this from the Wiki:
{fabrik view=list id=3 tablename___id=2}

The list displays, but shows all the records. What have I done wrong ? Thanks.


 
Thanks OndrejH - your suggestion implements filtering, but now I see no records. Permissions for viewing and editing records are Public so this shouldn't be problem.

I've just remembered I've been down this route before - see post http://fabrikar.com/forums/index.php?threads/placeholder-syntax.26599/#post-142248
In this post troester said that this syntax was working with him
{fabrik view=list id=3 events___id=2} but I've tried this and I just see the entire list.
 
Sorry - still displays all the records. I tried a few other combinations of the [] but each time I get all the records. At present I'm using the suggestion by Jaanus in the previous post of creating separate lists each with a suitable pre-filter but it would be nice to get this place-holder filtering working.
 
This will work placed in form or list introduction or footer sections:

{fabrik view=list id=3 events___id=[{placeholder}]

Note there is no curly bracket at the end.
 
I am trying to put the filtered list placeholder in an article - see the image below. This is achieved by a cloned list with a pre-filter to pick up any Venue containing the word "gallery". Works brilliantly. I'd like to be able to achieve the same without needing a list clone.
 

Attachments

  • fabrikforum2604a.png
    fabrikforum2604a.png
    61.9 KB · Views: 108
Thanks again for your time on this.
This code fails if placed in an article. I've not used the header and footer sections of a list and I'm not sure why you would want to put a filtered list above the full list. I'm also not sure what {placeholder} represents. I replaced it with the id value and put it in the header section of the list but nothing appeared - maybe there is a toggle somewhere saying "Show Header" which I've not found.

I accept your statement that the latest syntax does work in form/list headers and footers - but it looks might odd with no closing brace ! But I suppose its like omitting the closing php tag.
 
Apology to OndrejH first....
When we started adding the list name to the string I got the list id wrong - so the table name as part of the element was inconsistent with the list Id. Not unreasonable that there was no filtering. Sorry !

This format works
{fabrik view=list id=4 events___id=3}


..which is in the format that troester has quoted above. And is the same format that he set out in the 2012 post quoted above.
At the end of troester's 2012 post he asked for debug information. This time I followed his advice and enabled debug ( not in Fabrik but J! Global -> Fabrik section ) and then added ?fabrikdebug=1 and looked for the WHERE clause in list GetData:Events...
SELECT SQL_CALC_FOUND_ROWS `events`.`id` AS `events___id`, `events`.`id` AS `events___id_raw`, `events`.`category_id` AS `events___category_id_raw`, `categories`.`name` AS `events___category_id`, `events`.`event_name` AS `events___event_name`, `events`.`event_name` AS `events___event_name_raw`, `events`.`venue` AS `events___venue`, `events`.`venue` AS `events___venue_raw`, `events`.`start` AS `events___start`, `events`.`start` AS `events___start_raw`, `events`.`end` AS `events___end`, `events`.`end` AS `events___end_raw`, `events`.`description` AS `events___description`, `events`.`description` AS `events___description_raw`, `events`.`attachment` AS `events___attachment`, `events`.`attachment` AS `events___attachment_raw`, `events`.`user_id` AS `events___user_id`, `events`.`user_id` AS `events___user_id_raw`, `events`.`id` AS slug , `events`.`id` AS `__pk_val` FROM `events` LEFT JOIN `categories` AS `categories` ON `categories`.`id` = `events`.`category_id` WHERE ( `events`.`id` = 3 )

And there it is !
Interestingly, in the light of troester's last post the filter is on a PK and it is working. This is J! 3.3.6 Fabrik 3.2.
Thanks to everyone for their help and once again apologies for taking this post 'round the houses' Not only is my problem solved but I've discovered a gold-mine of information in the debug output !

 
Ok, ignore the issue.
It IS working on most of my lists, too.

I just used the one where it isn't doing. I have to do more tests why it's not working in this case.
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top