Thursday, October 14, 2010

DotNetNuke Pro - A cheap SQL Query to display all pages with unapproved content

Here is a very cheap way to display all of the pages on your site with unapproved content on them. Be sure to check the WorkFlowState table in DNN to ensure that your are selecting the correct workflow state(s), you may have more than one StateID to add to this query if you have been creating custom workflows.

<asp:DataList ID="DataList_Portal0" runat="server"
            DataSourceID="SqlDataSource_Portal0" >
            <ItemTemplate>
                <a href='http://www.yoursitename.com<%#Eval("TabPath").ToString().Replace("//","/") %>.aspx'>http://www.yoursitename.com<%#Eval("TabPath").ToString().Replace("//","/") %>.aspx</a>
            </ItemTemplate>
        </asp:DataList>
        <asp:SqlDataSource ID="SqlDataSource_Portal0" runat="server"
            ConnectionString="<%$ ConnectionStrings:SiteSqlServer %>"
            SelectCommand="          
                SELECT [TabPath] FROM [Tabs] WHERE [TabID] IN
                (
               SELECT [TabID] FROM TabModules WHERE [ModuleID] IN
               (
                   SELECT [ModuleID] FROM [HtmlText]
                    WHERE StateID=5

               )
                )">
        </asp:SqlDataSource>

No comments:

Post a Comment