16

I have a page layout with some web parts outside of a webpart zone so that they are added to already created pages which use the page layout.

I want to add a page field filter to the page as well and connect it to the web parts.

I got the filter to add to a page inside of a web part zone, and the connections added outside of the web part zone. However, since the filter is inside of the web part zone, it isn't added to pages I have already created using the layout.

QUESTION: How do I add a page field filter to a page layout outside of a web part zone? Is it even possible?

My HTML Snippets for the filter and connections:

<!--MS:<WpNs0:PageContextFilterWebPart
    ID="ClientNameFilterId"
    runat="server" PageFieldGuid="031c6c97-22db-4e30-8ebb-ad652b0c8263" FilterName="ClientNameFilterName"
    Title="ClientNameFilterTitle" FrameType="None" SuppressWebPartChrome="False" SendEmptyWhenNoValues="True"
    Description="Filter web parts based on the Client Name" IsIncluded="True"
    FrameState="Normal" AllowRemove="True" AllowZoneChange="False" AllowMinimize="True"
    AllowConnect="True" AllowEdit="True" AllowHide="True" IsVisible="True" CatalogIconImageUrl="/_layouts/images/wp_Filter.gif"
    TitleIconImageUrl="/_layouts/images/wp_Filter.gif" DetailLink="" HelpLink="" HelpMode="Modeless" Dir="Default"
    PartImageSmall="/_layouts/images/wp_Filter.gif" MissingAssembly="Cannot import this web part."
    ImportErrorMessage="Cannot import this web part." PartImageLarge="/_layouts/images/wp_Filter.gif"
    IsIncludedFilter="" ExportControlledProperties="True">-->
<!--ME:</WpNs0:PageContextFilterWebPart>-->

<!--SPM:<WebPartPages:SPProxyWebPartManager runat="server" ID="__ProxyWebPartManagerForConnections__">-->
<!--SPM:    <SPWebPartConnections>-->
<!--SPM:        <WebPartPages:SPWebPartConnection ConsumerConnectionPointID="DFWP Filter Consumer ID" ConsumerID="XsltListViewWebPartContacts" ID="ContactClientConnection" ProviderConnectionPointID="ITransformableFilterValues" ProviderID="ClientNameFilterId">-->
<!--SPM:            <WebPartPages:TransformableFilterValuesToParametersTransformer ConsumerFieldNames="Client" ProviderFieldNames="ClientNameFilterName">-->
<!--SPM:            </WebPartPages:TransformableFilterValuesToParametersTransformer>-->
<!--SPM:        </WebPartPages:SPWebPartConnection>-->
<!--SPM:        <WebPartPages:SPWebPartConnection ConsumerConnectionPointID="DFWP Filter Consumer ID" ConsumerID="XsltListViewWebPartProjects" ID="ProjectsClientConnection" ProviderConnectionPointID="ITransformableFilterValues" ProviderID="ClientNameFilterId">-->
<!--SPM:            <WebPartPages:TransformableFilterValuesToParametersTransformer ConsumerFieldNames="Client" ProviderFieldNames="ClientNameFilterName">-->
<!--SPM:            </WebPartPages:TransformableFilterValuesToParametersTransformer>-->
<!--SPM:        </WebPartPages:SPWebPartConnection>-->
<!--SPM:        <WebPartPages:SPWebPartConnection ConsumerConnectionPointID="DFWP Filter Consumer ID" ConsumerID="XsltListViewWebPartClientDocuments" ID="DocumentsClientsConnection" ProviderConnectionPointID="ITransformableFilterValues" ProviderID="ClientNameFilterId">-->
<!--SPM:            <WebPartPages:TransformableFilterValuesToParametersTransformer ConsumerFieldNames="Client" ProviderFieldNames="ClientNameFilterName">-->
<!--SPM:            </WebPartPages:TransformableFilterValuesToParametersTransformer>-->
<!--SPM:        </WebPartPages:SPWebPartConnection>-->
<!--SPM:    </SPWebPartConnections>-->
<!--SPM:</WebPartPages:SPProxyWebPartManager>-->

This is the error I get when I preview the layout or create a new page when the filter snippet is not in a webpart zone snippet:
Error message screenshot

  • It is not very clear what you need. In a page layout it is up to you to decide where you put your snippets, and basically it is on the page itself. – Marpio May 12 '14 at 7:29
  • If I put my filter snippet inside of a webpart zone snippet, the page layout works fine. If I don't put my filter snippet inside of a webpart zone snippet, the page layout doesn't work. I can upload it, and it translates into aspx without any errors. However, when I preview the page layout or try to create a page from the layout, I get the error message that I added to my post. I want to put the filter snippet outside of a webpart zone so that any changes I make to the page layout will be reflected in any already created pages which use the layout. – djmsmith May 12 '14 at 15:33
  • I have tried and had no troubles to put just in the page. Probably you have to check the content type you are using. Anyway a filter snippet not related to a webpart makes no sense since you cannot set a connection later. – Marpio May 13 '14 at 8:25
  • @Marpio I am connecting the snippet to other webparts on the page which are not in a webpart zone and I have not shown in this question. I can show them if you want me to. Can you post your html which worked? – djmsmith May 14 '14 at 14:20
  • Can you get the log details (from file system) for the error. – bkk Nov 25 '15 at 5:49
1

Add a jquery script that will move the existing webpart's div element to the desired location.

This should looks like:

$("#source").appendTo("#destination");

You can add the script in a Content Webpart or script webpart

0

djmsmith just add your filter code snippet into Contain placeholder main in the master page and then try to deploy the custom web part zones.

0

What you are describing sounds like a discrepancy between configurations of your webpart inside the wpzone vs outside of it. Maybe take a look at the WP in the wpzone (use SP Designer) and compare your properties to the WP outside the wpzone?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.