how to filter custom fields in content query webpart


  • I have a Employee list which has a "type" column and i am using employee list in my content query webpart and now i should filter type column in my cqwp .how to achieve this?


    • Edited by sree_23 Monday, April 30, 2012 6:28 AM
    Monday, April 30, 2012 3:50 AM

All replies

  • May i know what is "type" column, what data type it is.

    You can use the filter options in the content query webpart or use the filters web parts and connect with the content query webpart

    Monday, April 30, 2012 6:54 AM
  • I have a All button and post button,on click of All it should display the values from custom list(entity type=all) and display in content query webpart. how can we implement?


    • Edited by sree_23 Monday, April 30, 2012 10:01 AM
    Monday, April 30, 2012 7:29 AM
  • On All button or post button click event you would like to populate the data from the custom list to content query web part

    By default content query web part, it will pull the data from the list and you can modify the UI using custom xslt, can apply grouping and filtering

    May be on your button click pass the values by query param and filter the content query web part by query params

    If still you are expecting more functionality, develop your own custom web part 

    Tuesday, May 01, 2012 2:17 PM
  • Hello raghu, appreciate your reply :)

    i need to achieve this in button click ,when i click it should filter in my content query webpart so do i need to write caml query in my button click or any other way?


    Wednesday, May 02, 2012 5:29 AM
  • Hi Sree,

    No need to write caml query on button click, pass the value to the current page by appending the "all", "post" values as querystring params using java script or code on your button click

    Ex: On All button click pass the parameter /sites/x..../abc.aspx?k="All"

    Install below wsp and configure the web part

    Wednesday, May 02, 2012 6:56 AM
  • i tried ,got to implement list(Dynamic)in my cqwp through programmtically. pls help


    • Edited by sree_23 Thursday, May 03, 2012 9:51 AM
    Thursday, May 03, 2012 9:06 AM
  • i have my custom cqwp now when i put my cqwp inside any sub site it should recognize corresponding list name and hence i should implement dynamic cqwp so where ever i place my webpart any subsite or subsite's subsite then it has to recognize that specific list inside the subsite.

    as of now i have specified the list name in my cqwp code and it has that list in that subsite but now i need to implement in the above mentioned way


    Friday, May 04, 2012 5:24 AM
  • Hi,

    Can you elaborate more how you are created custom cqwp and the list configurations because at list level settings have you enabled the content type

    To get the same behavior may be you can configure the buttons also in the Custom item style in the ItemStyle file

    Create buttons in the xslt and add the java script event for those buttons.... you can do something

    Give me more clarity on your requirement

    Friday, May 04, 2012 7:24 AM
  • i have All button in my page and i need to filter cqwp on my button click


    • Edited by sree_23 Monday, May 07, 2012 3:59 AM
    Monday, May 07, 2012 3:50 AM