none
Content query show unpublished pages

    Question

  • Content Query
    Link: Name
    Link: Name1
    Link: Name2

    I got this Content Query the links are pages.
    I use the feature publish.
    Now I got the following problem.
    I want to make the page visible for the read only users. This I wanted to do with publising but if a page are unpublished the page is already visible in the content query.
    The pages have the content type article.
    So how can I make a page visible by publishing for only the read only users.

    Things I tryed already:
    I tryed to change the content type. Not working.
    I tryed to check in and check out the pages(unpublished). Not working.
    I tryed to automatic check out the page(unpublished). Not working.
    Unpublish and publish sites. Working.

    • Moved by Mike Walsh FIN Thursday, March 4, 2010 4:05 PM content q (From:SharePoint - General Question and Answers and Discussion (pre-SharePoint 2010))
    • Edited by PW19 Monday, March 8, 2010 6:25 AM
    Thursday, March 4, 2010 3:54 PM

All replies

  • Please don't use an image for something (text only) that could easily have been placed into the post itself without any loss of clarity.

    It's unnecessary that people need to click on an image in order to understand your question.


    (Moderator)
    FAQ sites: (SP 2010) http://wssv4faq.mindsharp.com; (v3) http://wssv3faq.mindsharp.com and (WSS 2.0) http://wssv2faq.mindsharp.com
    Complete Book Lists (incl. foreign language) on each site.
    Thursday, March 4, 2010 4:04 PM
  • Hi,

    Can you please rewrite the question? You might not be getting any replies because your original question is a bit hard to understand.

    Saturday, March 6, 2010 1:26 PM
  • Done hope you can understand it now.
    Monday, March 8, 2010 6:23 AM
  • Still nothing?
    Wednesday, March 10, 2010 7:58 AM
  • In the properties of the content query web part you can set a filter to only show pages which have an approval status of approved (I think the actual value may be something like 1#;Approved, you can only the pages library in datasheet view to check). Also make sure that in the query you have set the list/library type to be from a pages library.
    Wednesday, March 10, 2010 10:46 AM
  • In the properties of the content query web part you can set a filter to only show pages which have an approval status of approved (I think the actual value may be something like 1#;Approved, you can only the pages library in datasheet view to check). Also make sure that in the query you have set the list/library type to be from a pages library.

    Oke but there is no filter such as "Approval status" do I need to make a column and add it to my content or do I need to make a workflow with approval status??
    Wednesday, March 10, 2010 1:29 PM
  • nvm found out the problem for some reason "Require content approval for submitted items?" was turned to no so the option "Only users who can approve items (and the author of the item)" was not able to select(in library version settings of pages). And need to disable no version on the version tab of list library.
    Did some research on the net and found those options.
    • Marked as answer by PW19 Wednesday, March 10, 2010 1:49 PM
    • Unmarked as answer by PW19 Thursday, March 11, 2010 10:52 AM
    • Edited by PW19 Thursday, March 11, 2010 10:57 AM
    Wednesday, March 10, 2010 1:48 PM
  • nvm found out the problem for some reason "Require content approval for submitted items?" was turned to no so the option "Only users who can approve items (and the author of the item)" was not able to select(in library version settings of pages). And need to disable no version on the version tab of list library.
    Did some research on the net and found those options.
    Hmm problem returned any1 can help to fix this?
    Not sure but the problem seems to be diffecault for me now...
    The if I make a change in to unpublished page it wil removed from the content query and after some minutes it returned.
    Wednesday, March 10, 2010 2:00 PM
  • Still not fixed this myself any help would be fine...
    Monday, March 15, 2010 9:01 AM


  • I think it's probably important to point out that with publishing, a page is only "unpublished" until you publish it for the first time.

    Once you publish a page, and then edit it, the page does not become "unpublished". There is now an unpublished (draft) version and a published version, which may be why you are seeing what you believe to be an unpublished version in your CQWP.

    Does that help at all?

    Monday, March 15, 2010 3:07 PM
  • I know the different between unpublished and published realy.
    The problem is if I check it in its already visible in the CQWP, so what does publishing and unpublishing on a page then?
    I just get a access denied if a visitor click on the link now....
    Monday, March 15, 2010 7:21 PM
  • still no solution?
    Tuesday, March 23, 2010 1:54 PM
  • still no solution?
    Tuesday, March 23, 2010 1:54 PM
  • Hi,

    Maybe do an export of your CQWP and post the xml here. I'll take a look.

    Paul.

    Tuesday, March 23, 2010 4:47 PM
  • Export your CQWP and use QueryOverride to further specify your filtering options. There you have lot more options that are not provided by OOTB content query web part properties.

    This works great when you only want to display approved items from the lists.  By default, the approval flag is not listed on the filter properties of the CQWP.

    Refer to the following article for detailed:

    http://msdn.microsoft.com/en-us/library/aa981241.aspx

     

    Hope that helps.

    Tuesday, March 23, 2010 7:47 PM
  • Hi,

    Maybe do an export of your CQWP and post the xml here. I'll take a look.

    Paul.


    <webParts>
      <webPart xmlns="http://schemas.microsoft.com/WebPart/v3">
        <metaData>
          <type name="Microsoft.SharePoint.Publishing.WebControls.ContentByQueryWebPart, Microsoft.SharePoint.Publishing, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" />
          <importErrorMessage>Cannot import this Web Part.</importErrorMessage>
        </metaData>
        <data>
          <properties>
            <property name="GroupBy" type="string" />
            <property name="FilterValue2" type="string" />
            <property name="BaseType" type="string" />
            <property name="AllowConnect" type="bool">True</property>
            <property name="ShowUntargetedItems" type="bool">False</property>
            <property name="DisplayName" type="string" />
            <property name="Title" type="string">nieuwste product</property>
            <property name="ContentTypeName" type="string">Article Page</property>
            <property name="ViewFlag" type="string">0</property>
            <property name="MediaPlayerStyleSource" type="string" />
            <property name="AdditionalGroupAndSortFields" type="string" />
            <property name="GroupByDirection" type="Microsoft.SharePoint.Publishing.WebControls.ContentByQueryWebPart+SortDirection, Microsoft.SharePoint.Publishing, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c">Desc</property>
            <property name="GroupByFieldType" type="string" />
            <property name="FilterOperator1" type="Microsoft.SharePoint.Publishing.WebControls.ContentByQueryWebPart+FilterFieldQueryOperator, Microsoft.SharePoint.Publishing, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c">Eq</property>
            <property name="FeedTitle" type="string" />
            <property name="FilterOperator3" type="Microsoft.SharePoint.Publishing.WebControls.ContentByQueryWebPart+FilterFieldQueryOperator, Microsoft.SharePoint.Publishing, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c">Eq</property>
            <property name="SortByDirection" type="Microsoft.SharePoint.Publishing.WebControls.ContentByQueryWebPart+SortDirection, Microsoft.SharePoint.Publishing, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c">Desc</property>
            <property name="FilterDisplayValue3" type="string" />
            <property name="FilterDisplayValue2" type="string" />
            <property name="FilterDisplayValue1" type="string" />
            <property name="FilterValue3" type="string" />
            <property name="DataMappings" type="string">LinkUrl:{94f89715-e097-4e8b-ba79-ea02aa8b7adb},FileRef,Lookup;|Description:|ImageUrl:{543bc2cf-1f30-488e-8f25-6fe3b689d9ac},PublishingRollupImage,Image;|Title:{fa564e0f-0c70-4ab9-b863-0177e6ddd247},Title,Text;|</property>
            <property name="ListGuid" type="string">870fd70b-cc91-4c8a-bc5d-25ec06e4fbfa</property>
            <property name="ListUrl" type="string" null="true" />
            <property name="FilterValue1" type="string" />
            <property name="CacheXslStorage" type="bool">True</property>
            <property name="MissingAssembly" type="string">Cannot import this Web Part.</property>
            <property name="ItemLimit" type="int">5</property>
            <property name="DataMappingViewFields" type="string">{94f89715-e097-4e8b-ba79-ea02aa8b7adb},Lookup;{543bc2cf-1f30-488e-8f25-6fe3b689d9ac},Image;{fa564e0f-0c70-4ab9-b863-0177e6ddd247},Text;</property>
            <property name="XslLink" type="string" null="true" />
            <property name="DataColumnRenames" type="string" />
            <property name="AllowMinimize" type="bool">True</property>
            <property name="ContentTypeBeginsWithId" type="string" />
            <property name="ListDisplayName" type="string" null="true" />
            <property name="ListsOverride" type="string" />
            <property name="ItemXslLink" type="string" />
            <property name="Height" type="string" />
            <property name="SortBy" type="string">Created</property>
            <property name="CatalogIconImageUrl" type="string" />
            <property name="Default" type="string" />
            <property name="FilterType1" type="string" />
            <property name="FireInitialRow" type="bool">True</property>
            <property name="AsyncRefresh" type="bool">False</property>
            <property name="ItemStyle" type="string">Default</property>
            <property name="AdditionalFilterFields" type="string" />
            <property name="WebUrl" type="string">/sites/MMPatrick/Producten/Laptops/15 inch</property>
            <property name="ViewFlags" type="Microsoft.SharePoint.SPViewFlags, Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c">None</property>
            <property name="Width" type="string" />
            <property name="DataSourceID" type="string" />
            <property name="HelpUrl" type="string" />
            <property name="ManualRefresh" type="bool">False</property>
            <property name="PlayMediaInBrowser" type="bool">True</property>
            <property name="QueryOverride" type="string" />
            <property name="CacheXslTimeOut" type="int">86400</property>
            <property name="PageSize" type="int">-1</property>
            <property name="UseSQLDataSourcePaging" type="bool">True</property>
            <property name="FeedEnabled" type="bool">False</property>
            <property name="CommonViewFields" type="string" />
            <property name="FilterField3" type="string" />
            <property name="Hidden" type="bool">False</property>
            <property name="MainXslLink" type="string" />
            <property name="ExportMode" type="exportmode">All</property>
            <property name="FilterType3" type="string" />
            <property name="FilterType2" type="string" />
            <property name="ViewFieldsOverride" type="string" />
            <property name="DisplayColumns" type="int">1</property>
            <property name="FilterIncludeChildren2" type="bool">False</property>
            <property name="ParameterBindings" type="string" />
            <property name="FilterByAudience" type="bool">False</property>
            <property name="DataSourcesString" type="string" />
            <property name="AllowHide" type="bool">True</property>
            <property name="Filter2ChainingOperator" type="Microsoft.SharePoint.Publishing.WebControls.ContentByQueryWebPart+FilterChainingOperator, Microsoft.SharePoint.Publishing, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c">Or</property>
            <property name="ListId" type="System.Guid, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">00000000-0000-0000-0000-000000000000</property>
            <property name="XmlDefinitionLink" type="string" />
            <property name="DataFields" type="string" />
            <property name="FilterIncludeChildren1" type="bool">False</property>
            <property name="SortByFieldType" type="string">DateTime</property>
            <property name="InitialAsyncDataFetch" type="bool">False</property>
            <property name="ChromeType" type="chrometype">TitleOnly</property>
            <property name="SystemViewFields" type="string" />
            <property name="XmlDefinition" type="string" />
            <property name="ChromeState" type="chromestate">Normal</property>
            <property name="Filter2IsCustomValue" type="bool">False</property>
            <property name="PageType" type="Microsoft.SharePoint.PAGETYPE, Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c">PAGE_NORMALVIEW</property>
            <property name="FeedDescription" type="string" />
            <property name="Filter3IsCustomValue" type="bool">False</property>
            <property name="SampleData" type="string">&lt;dsQueryResponse&gt;
                        &lt;Rows&gt;
                            &lt;Row Title="Item 1" LinkUrl="http://Item1" Group="Group Header" __begincolumn="True" __begingroup="True" /&gt;
                            &lt;Row Title="Item 2" LinkUrl="http://Item2" __begincolumn="False" __begingroup="False" /&gt;
                            &lt;Row Title="Item 3" LinkUrl="http://Item3" __begincolumn="False" __begingroup="False" /&gt;
                        &lt;/Rows&gt;
                        &lt;/dsQueryResponse&gt;</property>
            <property name="FilterOperator2" type="Microsoft.SharePoint.Publishing.WebControls.ContentByQueryWebPart+FilterFieldQueryOperator, Microsoft.SharePoint.Publishing, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c">Eq</property>
            <property name="GroupStyle" type="string">DefaultHeader</property>
            <property name="WebsOverride" type="string" />
            <property name="AutoRefreshInterval" type="int">60</property>
            <property name="UseCopyUtil" type="bool">False</property>
            <property name="TitleUrl" type="string" />
            <property name="Filter1ChainingOperator" type="Microsoft.SharePoint.Publishing.WebControls.ContentByQueryWebPart+FilterChainingOperator, Microsoft.SharePoint.Publishing, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c">Or</property>
            <property name="ViewContentTypeId" type="string" />
            <property name="HeaderXslLink" type="string" />
            <property name="Xsl" type="string">&lt;xsl:stylesheet xmlns:x="http://www.w3.org/2001/XMLSchema" version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:cmswrt="http://schemas.microsoft.com/WebPart/v3/Publishing/runtime" exclude-result-prefixes="xsl cmswrt x" &gt; &lt;xsl:import href="/Style Library/XSL Style Sheets/Header.xsl" /&gt; &lt;xsl:import href="/Style Library/XSL Style Sheets/ItemStyle.xsl" /&gt; &lt;xsl:import href="/Style Library/XSL Style Sheets/ContentQueryMain.xsl" /&gt; &lt;/xsl:stylesheet&gt;</property>
            <property name="TitleIconImageUrl" type="string" />
            <property name="HelpMode" type="helpmode">Modal</property>
            <property name="Direction" type="direction">NotSet</property>
            <property name="FilterField2" type="string" />
            <property name="ListName" type="string">Pages</property>
            <property name="ShowWithSampleData" type="bool">False</property>
            <property name="AllowClose" type="bool">True</property>
            <property name="Filter1IsCustomValue" type="bool">False</property>
            <property name="Description" type="string">Displays a dynamic view of content from your site.</property>
            <property name="UseCache" type="bool">True</property>
            <property name="FilterField1" type="string" />
            <property name="AutoRefresh" type="bool">False</property>
            <property name="AllowZoneChange" type="bool">True</property>
            <property name="ServerTemplate" type="string">850</property>
            <property name="NoDefaultStyle" type="string" />
            <property name="AllowEdit" type="bool">True</property>
            <property name="FilterIncludeChildren3" type="bool">False</property>
          </properties>
        </data>
      </webPart>
    </webParts>
    Wednesday, March 24, 2010 9:24 AM
  • I did some playing around with this and you are right. The behaviour is a little strange for read only users.

    I filtered the content query so that pages will only show when Approval Status=Approved and Checked out user != "".

    This works well for people with full control or contributor rights, but doesn't seem to work for people with read-only rights.

    I believe that this is due to one of the versioning settings on the pages library, "Draft Item Security". Change this value to "Any user who can read items" and the filtering seems to work correctly.

    Wednesday, March 24, 2010 1:45 PM
  • I did some playing around with this and you are right. The behaviour is a little strange for read only users.

    I filtered the content query so that pages will only show when Approval Status=Approved and Checked out user != "".

    This works well for people with full control or contributor rights, but doesn't seem to work for people with read-only rights.

    I believe that this is due to one of the versioning settings on the pages library, "Draft Item Security". Change this value to "Any user who can read items" and the filtering seems to work correctly.


    I did versioning already but after 5 mins the page comes up again and then got same problem..

    And how to edit the xml Iam not good in scripts...

    Thursday, March 25, 2010 8:08 AM
  • You don't need to edit the xml.

    Maybe you need to try a different approach? Have you tried this out with a Data View Web Part instead of the CQWP?

    Thursday, March 25, 2010 12:16 PM
  • not yet should try it thanks. Where to find it need any feature to be enabled?
    Thursday, March 25, 2010 12:21 PM
  • You'll need SharePoint designer to create a DVWP. I don't have a lot of experience with using it, but there are plenty of resources on the web to help you get started.

    Sorry I can't be of more help

    Paul.

    Thursday, March 25, 2010 1:10 PM
  • IAm not good in designer so hope there comes a other solution on the CQWP.
    Thursday, March 25, 2010 1:14 PM
  • Hi

    I know this is quite an old post now, but I found out something interesting today that doesn't seem to be documented, or at least, I was unable to get a clear definition of the functionality by searching the web.

    As this seems to be an important piece of information that for me proved hard to find, and to potentially save others from the many hours I've spent today testing to convince myself that it's the intended behaviour and not a bug, I thought I'd share what I've discovered.

    When a document library has major and minor versioning enabled, an 'Unpublish this version' command appears in the Item's action menu. When this command is used and the library is set to hide drafts from read-only users, the previously published (major) version doesn't appear to read-only users, in fact, the item disappears completely as far as read-only users are concerned.

    I just checked it with the CQWP and it disappears from there too for read-only users.

    Also, as the default search crawl account is a read-only account, the item also disappears from the search results for ALL users.

    I hope this is useful.

    Lee

    Thursday, May 26, 2011 7:04 PM