locked
CQWP(Content Query Web Part) Filtering RRS feed

  • Question

  • Good afternoon all,

    I've spent about an hour looking thru the post on cqwp and did not see what i'm trying to do.  I'm working with Moss2007 and would like to apply a filter so that only 2 calendar list out of about 15 will show in this webpart.  Is it possible to filter using the List Name or the id associated with the list.  I want to show only the 2 calendar list.  If it is possible, can someone direct me to a tutorial?  I'm not using code or SPD, just OOB.

    Thanks,

    Art

    • Moved by star.warsModerator Monday, April 23, 2012 9:44 AM SP 2007 question (From:SharePoint 2010 - General Questions and Answers)
    Friday, April 20, 2012 4:48 PM

Answers

  • Hi aikiart7,

    SharePoint Content Query Web Part doesn’t provide a way to filter the web part content based on list name or list id. If you don’t want to custom web part to achieve this, you may try to use the default filter and add columns with filter value to meet the requirement.

    As to your scenario, you can try to add a column in each calendar list to store the ListID value using programming as it is not easy to operate this from user interface, and add event receiver to add the column value when adding an item, more information about event receiver, please refer to:
    http://msdn.microsoft.com/en-us/library/gg252010.aspx

    Thanks,
    Qiao


    Qiao Wei

    TechNet Community Support

    • Marked as answer by Shimin Huang Friday, May 4, 2012 7:15 AM
    Wednesday, April 25, 2012 7:34 AM
    Moderator

All replies

  • The best way would be to create a custom content type for those 2 calendar and use it during filtering.
    Saturday, April 21, 2012 12:06 PM
  • Check out this forum thread-

    http://social.msdn.microsoft.com/Forums/en/sharepointcustomization/thread/9f99976b-70dc-4f37-a87c-b62a7c89a5a7

    Hope this helps!!!


    Please "Mark As Answer" if my post solves your problem or "Vote As Helpful" if a post has been helpful for you.

    Saturday, April 21, 2012 12:11 PM
  • Ramez,

    What if one of the calendars already exists and has hundreds of entries, can it be associated with a custom content type and if so, how would that be done?

    Thanks,

    Art

    Saturday, April 21, 2012 2:15 PM
  • Suraj,

    The article does not refer 2 two calendars, it refers to items in a list.  The problem i have is that i have a site that has about 30 calendars but I only want to show 2 in one web part, i wanted to use the filter to show the 2 list, i'm using moss 2007 and trying to do it using OOB, rather than designer or visual studio.

    Thanks,

    Art

    Saturday, April 21, 2012 2:18 PM
  • Hi aikiart7,

    SharePoint Content Query Web Part doesn’t provide a way to filter the web part content based on list name or list id. If you don’t want to custom web part to achieve this, you may try to use the default filter and add columns with filter value to meet the requirement.

    As to your scenario, you can try to add a column in each calendar list to store the ListID value using programming as it is not easy to operate this from user interface, and add event receiver to add the column value when adding an item, more information about event receiver, please refer to:
    http://msdn.microsoft.com/en-us/library/gg252010.aspx

    Thanks,
    Qiao


    Qiao Wei

    TechNet Community Support

    • Marked as answer by Shimin Huang Friday, May 4, 2012 7:15 AM
    Wednesday, April 25, 2012 7:34 AM
    Moderator
  • The calendar is a list so you can export to excel file and then reimport using the new custom content type

    if this answered your question please mark as answered

    Wednesday, April 25, 2012 2:04 PM
  • Use the ListsOverride property of the Content Query Webpart and give the List GUID of the required calendar lists. Please refer to MSDN article.
    Monday, April 30, 2012 1:21 PM