none
Is it even possible to filter a list view web part on a doc library page that's based on a page layout? RRS feed

  • Question

  • I'm losing my mind trying to do what on the surface I would think is fairly simple yet I can't get to work, so I was hoping someone could just tell me if its even possible so I can stop ripping my hair out.

    I have a document library. It's used to hold news articles posted to our sharepoint 2010 site.

    The layout of these articles is controlled by a page layout content type created in Sharepoint Designer.,

    On this page I want to have a web part that displays items from a sharepoint list. This list has a column (named "ArticleID") that holds a number that corresponds with the document ID of documents in my article document library so that one or more items in this list are associated with specific documents in the document library.

    I want to filter this list based on the ID of the currently viewed article so that it only shows items in the list who's ArticleID matches the ID of the currently viewed article.

    I'm trying to set this up in the page layout in Sharepoint Designer 2010.

    There are a few ways that I would think this could be achived with an XSLTListViewWebPart

    1) Binding a parameter to the list view from the currently view page. I thought this could be done with the Data View Parameters settings in Sharepoint Designer 2010, but I have yet to be successful and Microsoft doesn't seem to have ever written any documentation on how to do it (Microsoft's apparently incomplete documentation for a product they've released is an issue in itself!)

    2)Page Field Filter. I'm starting to think the fact that I can insert this web part in a page layout for a document library is a fluke as it doesn't allow me to configure it or connect it to another web part. If there is documentation on how to use this filter in SPD 2010 I have yet to find it.

    Please someone help me. Please!


    Saturday, October 15, 2011 12:32 AM

Answers

  • Hi fallenturtle,

     

    I’ve read over your posting and have found that the second option you presented wouldn’t be possible simply because as you had stated web part connections don’t work on page layouts. You can configure the connection but after you save and open it back up it loses the connection.

     

    As for the first option, what you may be able to do is set the web part on the page layout to look at a cookie, and in the cookie have javascript set the value to what is in the “Article ID” field so that way it can sort on that.

     


    Please remember to click 'Mark as Answer' on the post that helps you or click 'Unmark as Answer' if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.

    Regards,
    Manas Biswas
    Microsoft Online Community Support
    • Marked as answer by Emir Liu Friday, October 28, 2011 6:55 AM
    Monday, October 24, 2011 7:39 PM

All replies

  • Hi fallenturtle,

    I would like suggest you to insert a Data View Web Part to the page layouts, and get filter (Article library ID field) from query string. But when we open the article page from the library, there is no ID field in query string, so we also need to custom the AllItems.aspx page. Custom the default XSLT list view web part (or create a Data View Web Part instead), and add the query string to the hyperlink filed.

    Or you could try to use a list with a multiple lines of text type field instead of using a library and custom article page layouts. Similar like the default Posts and Comments list in blog site.

    Best regards,
    Emir

    Monday, October 17, 2011 10:24 AM
  • Hi fallenturtle,

    I would like suggest you to insert a Data View Web Part to the page layouts, and get filter (Article library ID field) from query string. But when we open the article page from the library, there is no ID field in query string, so we also need to custom the AllItems.aspx page. Custom the default XSLT list view web part (or create a Data View Web Part instead), and add the query string to the hyperlink filed.

    Or you could try to use a list with a multiple lines of text type field instead of using a library and custom article page layouts. Similar like the default Posts and Comments list in blog site.

    Best regards,
    Emir

    Emir, thank you for your response.

    I'm assuming that to pass it through the query string that every link to an article would require code to add a query string and that adding it to the allitems.aspx page would only work for articles selected from that page? In other words if I have a link to an article off the home page, it would not get its query string tacked on?

    I'm still confused to why I can't access the value through a control or some other not URL base parameter... did Microsoft not finish this part of the application or something?

    Edit: I searched the index of a book called Pro Sharepoint Designer 2010 and couldn't find anything about parameter bindings! Seriously, Microsoft, what the heck's up with the lack of documentation?!
    Monday, October 17, 2011 4:06 PM
  • Hi fallenturtle,

     

    I’ve read over your posting and have found that the second option you presented wouldn’t be possible simply because as you had stated web part connections don’t work on page layouts. You can configure the connection but after you save and open it back up it loses the connection.

     

    As for the first option, what you may be able to do is set the web part on the page layout to look at a cookie, and in the cookie have javascript set the value to what is in the “Article ID” field so that way it can sort on that.

     


    Please remember to click 'Mark as Answer' on the post that helps you or click 'Unmark as Answer' if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.

    Regards,
    Manas Biswas
    Microsoft Online Community Support
    • Marked as answer by Emir Liu Friday, October 28, 2011 6:55 AM
    Monday, October 24, 2011 7:39 PM
  • cookies were the answer! :)
    Wednesday, November 16, 2011 4:22 AM