0

I've got a issue that I have been sitting on for about 4 hours now. The page was created by another developer that I have to edit now and cannot seem to figure out.

The scenario is as follows.

Categories are added into the page as clickable blocks, this is pulled from a separate list into a web part on the page. The products per categories are also pulled from another list onto this page. When the user clicks a category at the top of the page the products are filtered to display only related products.

The client would like to load the page with no products being displayed until a user clicks on a specific category.

This is what I am working with for now, I cannot get the page to display no products first however the filters work correct, screenshot to follow, the first web part being the "category" bar and the second being the products.

<asp:Content ContentPlaceHolderId="PlaceHolderPageTitle" runat="server">
    <SharePoint:ListItemProperty Property="BaseName" maxlength="40" runat="server"/>
</asp:Content>
<asp:Content ContentPlaceHolderId="PlaceHolderPageTitleInTitleArea" runat="server">
                                        <h2>
                                            Store
                                        </h2>
    </asp:Content>
<asp:Content ContentPlaceHolderId="PlaceHolderTitleAreaClass" runat="server">
    <style type="text/css">
    Div.ms-titleareaframe {
    height: 100%;
    }
    .ms-pagetitleareaframe table {
    background: none;
    }
  </style>
</asp:Content>
<asp:Content ContentPlaceHolderId="PlaceHolderAdditionalPageHead" runat="server">
    <meta name="GENERATOR" content="Microsoft SharePoint" />
    <meta name="ProgId" content="SharePoint.WebPartPage.Document" />
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="CollaborationServer" content="SharePoint Team Web Site" />
    <script type="text/javascript">
// <![CDATA[
    var navBarHelpOverrideKey = "WSSEndUser";
// ]]>
    </script>
    <SharePoint:UIVersionedContent ID="WebPartPageHideQLStyles" UIVersion="4" runat="server">
        <ContentTemplate>
<style type="text/css">
body #s4-leftpanel {
    display:none;
}
.s4-ca {
    margin-left:0px;
}
</style>
        </ContentTemplate>
    </SharePoint:UIVersionedContent>
</asp:Content>
<asp:Content ContentPlaceHolderId="PlaceHolderMain" runat="server">

<!--[if lt IE 9]>
<script type="text/javascript">
alert ("It looks like you using Internet Explorer 8 or lower. To see the Online store correctly, please update to IE 9 or higher or load this page in Google Chrome.")
</script>


<![endif]-->


<link type="text/css" href="../SiteAssets/style.css" rel="stylesheet">
    <script src="../SiteAssets/jquery.isotope.min.js" type="text/javascript"></script>




<div class="contactinfo">
Interested in ordering?
<br/>
Contact Cliantha James for more information on the items here.
<br/>
<a href="mailto:mail@mail.com?Subject=Online Brand Store Query">
mail@mail.com</a>
</div>

  <div id="gallery">

<WebPartPages:DataFormWebPart runat="server" IsIncluded="True" AsyncRefresh="True" FrameType="None" NoDefaultStyle="TRUE" ViewFlag="8" Title="Promo Shop - Categories" PageType="PAGE_NORMALVIEW" ListName="{FD912C31-C4C1-4AE2-9C0E-6BC7D28FE6DE}" Default="FALSE" DisplayName="Promo Shop - Categories" __markuptype="vsattributemarkup" __WebPartId="{807A1620-854D-4D2E-8932-1A109AFA5A82}" id="g_807a1620_854d_4d2e_8932_1a109afa5a82" __AllowXSLTEditing="true" WebPart="true" Height="" Width="">
    <DataSources>
        <SharePoint:SPDataSource runat="server" DataSourceMode="List" UseInternalName="true" UseServerDataFormat="true" selectcommand="&lt;View&gt;&lt;Query&gt;&lt;OrderBy&gt;&lt;FieldRef Name=&quot;ID&quot; Ascending=&quot;TRUE&quot;/&gt;&lt;/OrderBy&gt;&lt;/Query&gt;&lt;/View&gt;" id="Promo_x0020_Shop_x0020__x002d__x0020_Categories2"><SelectParameters><WebPartPages:DataFormParameter Name="ListID" ParameterKey="ListID" PropertyName="ParameterValues" DefaultValue="{FD912C31-C4C1-4AE2-9C0E-6BC7D28FE6DE}"/></SelectParameters><DeleteParameters><WebPartPages:DataFormParameter Name="ListID" ParameterKey="ListID" PropertyName="ParameterValues" DefaultValue="{FD912C31-C4C1-4AE2-9C0E-6BC7D28FE6DE}"/></DeleteParameters><UpdateParameters><WebPartPages:DataFormParameter Name="ListID" ParameterKey="ListID" PropertyName="ParameterValues" DefaultValue="{FD912C31-C4C1-4AE2-9C0E-6BC7D28FE6DE}"/></UpdateParameters><InsertParameters><WebPartPages:DataFormParameter Name="ListID" ParameterKey="ListID" PropertyName="ParameterValues" DefaultValue="{FD912C31-C4C1-4AE2-9C0E-6BC7D28FE6DE}"/></InsertParameters></SharePoint:SPDataSource>
    </DataSources>
    <ParameterBindings>
    <ParameterBinding Name="ListID" Location="None" DefaultValue="{FD912C31-C4C1-4AE2-9C0E-6BC7D28FE6DE}"/>
    <ParameterBinding Name="dvt_apos" Location="Postback;Connection"/>
    <ParameterBinding Name="ManualRefresh" Location="WPProperty[ManualRefresh]"/>
    <ParameterBinding Name="UserID" Location="CAMLVariable" DefaultValue="CurrentUserName"/>
    <ParameterBinding Name="Today" Location="CAMLVariable" DefaultValue="CurrentDate"/>
</ParameterBindings>
    <datafields>@ID,ID;@ContentType,Content Type;@Created,Created;@Author,Created By;@Modified,Modified;@Editor,Modified By;@_CopySource,Copy Source;@CheckoutUser,Checked Out To;@FileLeafRef,Name (for use in forms);@_CheckinComment,Check In Comment;@CheckedOutTitle,Checked Out To;@CheckedOutUserId,ID of the User who has the item Checked Out;@FileDirRef,Path;@FSObjType,Item Type;@HTML_x0020_File_x0020_Type,HTML File Type;@File_x0020_Type,File Type;@IsCheckedoutToLocal,Is Checked out to local;@_SourceUrl,Source URL;@_HasCopyDestinations,Has Copy Destinations;@ContentTypeId,Content Type ID;@_ModerationStatus,Approval Status;@_UIVersion,UI Version;@Created_x0020_Date,Created;@FileRef,URL Path;@File_x0020_Size,File Size;@ItemChildCount,Item Child Count;@FolderChildCount,Folder Child Count;@_UIVersionString,Version;@ParentVersionString,Source Version (Converted Document);@ParentLeafName,Source Name (Converted Document);@PreviewExists,Preview Exists;@ThumbnailExists,Thumbnail Exists;@_Author,Author;@Title,Title;@ImageWidth,Width;@ImageHeight,Height;@ImageCreateDate,Date Picture Taken;@_Comments,Comments;@Keywords,Keywords;@wic_System_Copyright,Copyright;@AlternateThumbnailUrl,Preview Image URL;@MediaLengthInSeconds,Length (seconds);@PublishingStartDate,Scheduling Start Date;@PublishingExpirationDate,Scheduling End Date;@VideoWidthInPixels,Frame Width;@VideoHeightInPixels,Frame Height;</datafields>
    <XSL>
<xsl:stylesheet xmlns:x="http://www.w3.org/2001/XMLSchema" xmlns:d="http://schemas.microsoft.com/sharepoint/dsp" version="1.0" exclude-result-prefixes="xsl msxsl ddwrt" xmlns:ddwrt="http://schemas.microsoft.com/WebParts/v2/DataView/runtime" xmlns:asp="http://schemas.microsoft.com/ASPNET/20" xmlns:__designer="http://schemas.microsoft.com/WebParts/v2/DataView/designer" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:SharePoint="Microsoft.SharePoint.WebControls" xmlns:ddwrt2="urn:frontpage:internal">
    <xsl:output method="html" indent="no"/>
    <xsl:decimal-format NaN=""/>
    <xsl:param name="dvt_apos">&apos;</xsl:param>
    <xsl:param name="ManualRefresh"></xsl:param>
    <xsl:variable name="dvt_1_automode">0</xsl:variable>

    <xsl:template match="/" xmlns:x="http://www.w3.org/2001/XMLSchema" xmlns:d="http://schemas.microsoft.com/sharepoint/dsp" xmlns:asp="http://schemas.microsoft.com/ASPNET/20" xmlns:__designer="http://schemas.microsoft.com/WebParts/v2/DataView/designer" xmlns:SharePoint="Microsoft.SharePoint.WebControls">
        <xsl:choose>
            <xsl:when test="($ManualRefresh = 'True')">
                <table width="100%" border="0" cellpadding="0" cellspacing="0">
                    <tr>
                        <td valign="top">
                            <xsl:call-template name="dvt_1"/>
                        </td>
                        <td width="1%" class="ms-vb" valign="top">
                            <img src="/_layouts/images/staticrefresh.gif" id="ManualRefresh" border="0" onclick="javascript: {ddwrt:GenFireServerEvent('__cancel')}" alt="Click here to refresh the dataview."/>
                        </td>
                    </tr>
                </table>
            </xsl:when>
            <xsl:otherwise>
            <div class="container">
                <div class="row">
                    <div class="portfolioFilter text-center">
                        <xsl:call-template name="dvt_1"/>   
                    </div>
                </div>  
            </div>
            </xsl:otherwise>
        </xsl:choose>
    </xsl:template>

    <xsl:template name="dvt_1">
        <xsl:variable name="dvt_StyleName">RepForm3</xsl:variable>
        <xsl:variable name="Rows" select="/dsQueryResponse/Rows/Row"/>
        <xsl:variable name="dvt_RowCount" select="count($Rows)"/>
        <xsl:variable name="IsEmpty" select="$dvt_RowCount = 0" />
        <xsl:variable name="dvt_IsEmpty" select="$dvt_RowCount = 0"/>

        <xsl:choose>
            <xsl:when test="$dvt_IsEmpty">
                <xsl:call-template name="dvt_1.empty"/>
            </xsl:when>
            <xsl:otherwise>
                <table border="0" width="100%">
                    <xsl:call-template name="dvt_1.body">
                        <xsl:with-param name="Rows" select="$Rows"/>
                        </xsl:call-template>
                </table>
            </xsl:otherwise>
        </xsl:choose>
        </xsl:template>
    <xsl:template name="dvt_1.body">
        <xsl:param name="Rows"/>
        <xsl:for-each select="$Rows">
                    <xsl:call-template name="dvt_1.rowview" /></xsl:for-each>

    </xsl:template>

    <xsl:template name="dvt_1.rowview">
                <xsl:variable name="precate" select="translate(@Title,' ','-')"/>


    <a href="#" data-filter=".{$precate}" class="{@precate} categories">
        <img src="{@FileRef}" class="CatImage" alt="{@Title}"/>
        <div class="hover"><xsl:value-of select="@Title"/></div>
    </a>        


                    <xsl:if test="$dvt_1_automode = '1'" ddwrt:cf_ignore="1">
                                <span ddwrt:amkeyfield="ID" ddwrt:amkeyvalue="ddwrt:EscapeDelims(string(@ID))" ddwrt:ammode="view"></span>
                    </xsl:if>
    </xsl:template>
    <xsl:template name="dvt_1.empty">
        <xsl:variable name="dvt_ViewEmptyText">There are no items to show in this view.</xsl:variable>
        <table border="0" width="100%">
            <tr>
                <td class="ms-vb">
                    <xsl:value-of select="$dvt_ViewEmptyText"/>
                </td>
            </tr>
        </table>
    </xsl:template>
    </xsl:stylesheet>   </XSL>
</WebPartPages:DataFormWebPart>





<WebPartPages:DataFormWebPart runat="server" IsIncluded="True" AsyncRefresh="True" FrameType="None" NoDefaultStyle="TRUE" ViewFlag="8" Title="Promo Shop" PageType="PAGE_NORMALVIEW" ListName="{19A69ED6-141F-434F-9D22-BC27AAD49E7F}" Default="FALSE" DisplayName="Promo Shop" __markuptype="vsattributemarkup" __WebPartId="{9B6B016A-4B0F-42A1-B104-12CD2B2CE8C1}" id="g_9b6b016a_4b0f_42a1_b104_12cd2b2ce8c1" __AllowXSLTEditing="true" WebPart="true" Height="" Width="">
    <DataSources>
        <SharePoint:SPDataSource runat="server" DataSourceMode="List" UseInternalName="true" UseServerDataFormat="true" selectcommand="&lt;View&gt;&lt;Query&gt;&lt;OrderBy&gt;&lt;FieldRef 
        Name=&quot;Created_x0020_Date&quot; Ascending=&quot;FALSE&quot;/&gt;&lt;/OrderBy&gt;&lt;Where&gt;&lt;Or&gt;&lt;Eq&gt;&lt;FieldRef Name=&quot;Out_x0020_of_x0020_Stock&quot;/&gt;&lt;Value 
        Type=&quot;Boolean&quot;&gt;0&lt;/Value&gt;&lt;/Eq&gt;&lt;IsNull&gt;&lt;FieldRef 
        Name=&quot;Out_x0020_of_x0020_Stock&quot;/&gt;&lt;/IsNull&gt;&lt;/Or&gt;&lt;/Where&gt;&lt;/Query&gt;&lt;/View&gt;" 
id="Promo_x0020_Shop1">

        <SelectParameters><WebPartPages:DataFormParameter Name="ListID" ParameterKey="ListID" PropertyName="ParameterValues" DefaultValue="{19A69ED6-141F-434F-9D22-BC27AAD49E7F}"/></SelectParameters>

        <DeleteParameters><WebPartPages:DataFormParameter Name="ListID" ParameterKey="ListID" PropertyName="ParameterValues" DefaultValue=""/></DeleteParameters>

        <UpdateParameters><WebPartPages:DataFormParameter Name="ListID" ParameterKey="ListID" PropertyName="ParameterValues" DefaultValue="}"/></UpdateParameters>

        <InsertParameters><WebPartPages:DataFormParameter Name="ListID" ParameterKey="ListID" PropertyName="ParameterValues" DefaultValue=""/></InsertParameters></SharePoint:SPDataSource>

    </DataSources>
    <ParameterBindings>
    <ParameterBinding Name="ListID" Location="None" DefaultValue=""/>
    <ParameterBinding Name="dvt_apos" Location="Postback;Connection"/>
    <ParameterBinding Name="ManualRefresh" Location="WPProperty[ManualRefresh]"/>
    <ParameterBinding Name="UserID" Location="CAMLVariable" DefaultValue="CurrentUserName"/>
    <ParameterBinding Name="Today" Location="CAMLVariable" DefaultValue="CurrentDate"/>
</ParameterBindings>
    <datafields>@FileLeafRef,Name (for use in forms);@FileDirRef,Path;@FSObjType,Item Type;@PreviewExists,Preview Exists;@_ModerationStatus,Approval Status;@ThumbnailExists,Thumbnail Exists;@_Author,Author;@File_x0020_Type,File Type;@Title,Title;@ImageWidth,Width;@ImageHeight,Height;@ImageCreateDate,Date Picture Taken;@_Comments,Comments;@FileRef,URL Path;@HTML_x0020_File_x0020_Type,HTML File Type;@_UIVersion,UI Version;@_HasCopyDestinations,Has Copy Destinations;@Keywords,Keywords;@wic_System_Copyright,Copyright;@AlternateThumbnailUrl,Preview Image URL;@MediaLengthInSeconds,Length (seconds);@PublishingStartDate,Scheduling Start Date;@PublishingExpirationDate,Scheduling End Date;@VideoWidthInPixels,Frame Width;@VideoHeightInPixels,Frame Height;@Price,Price;@Category,Category;@Out_x0020_of_x0020_Stock,Out of Stock;@ID,ID;@ContentType,Content Type;@Created,Created;@Author,Created By;@Modified,Modified;@Editor,Modified By;@_CopySource,Copy Source;@CheckoutUser,Checked Out To;@_CheckinComment,Check In Comment;@CheckedOutTitle,Checked Out To;@CheckedOutUserId,ID of the User who has the item Checked Out;@IsCheckedoutToLocal,Is Checked out to local;@_SourceUrl,Source URL;@ContentTypeId,Content Type ID;@Created_x0020_Date,Created;@File_x0020_Size,File Size;@ItemChildCount,Item Child Count;@FolderChildCount,Folder Child Count;@_UIVersionString,Version;@ParentVersionString,Source Version (Converted Document);@ParentLeafName,Source Name (Converted Document);</datafields>


    <XSL>
<xsl:stylesheet xmlns:x="http://www.w3.org/2001/XMLSchema" xmlns:d="http://schemas.microsoft.com/sharepoint/dsp" version="1.0" exclude-result-prefixes="xsl msxsl ddwrt" xmlns:ddwrt="http://schemas.microsoft.com/WebParts/v2/DataView/runtime" xmlns:asp="http://schemas.microsoft.com/ASPNET/20" xmlns:__designer="http://schemas.microsoft.com/WebParts/v2/DataView/designer" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:SharePoint="Microsoft.SharePoint.WebControls" xmlns:ddwrt2="urn:frontpage:internal">
    <xsl:output method="html" indent="no"/>
    <xsl:decimal-format NaN=""/>
    <xsl:param name="dvt_apos">&apos;</xsl:param>
    <xsl:param name="ManualRefresh"></xsl:param>
    <xsl:variable name="dvt_1_automode">0</xsl:variable>

    <xsl:template match="/" xmlns:x="http://www.w3.org/2001/XMLSchema" xmlns:d="http://schemas.microsoft.com/sharepoint/dsp" xmlns:asp="http://schemas.microsoft.com/ASPNET/20" xmlns:__designer="http://schemas.microsoft.com/WebParts/v2/DataView/designer" xmlns:SharePoint="Microsoft.SharePoint.WebControls">
        <xsl:choose>
            <xsl:when test="($ManualRefresh = 'True')">
                <table width="100%" border="0" cellpadding="0" cellspacing="0">
                    <tr>
                        <td valign="top">
                            <xsl:call-template name="dvt_1"/>
                        </td>
                        <td width="1%" class="ms-vb" valign="top">
                            <img src="/_layouts/images/staticrefresh.gif" id="ManualRefresh" border="0" onclick="javascript: {ddwrt:GenFireServerEvent('__cancel')}" alt="Click here to refresh the dataview."/>
                        </td>
                    </tr>
                </table>
            </xsl:when>
            <xsl:otherwise>
                <div class="projects four isotope">
                    <xsl:call-template name="dvt_1"/>

                </div>

            </xsl:otherwise>
        </xsl:choose>
    </xsl:template>

    <xsl:template name="dvt_1">
        <xsl:variable name="dvt_StyleName">RepForm3</xsl:variable>
        <xsl:variable name="Rows" select="/dsQueryResponse/Rows/Row"/>
        <xsl:variable name="dvt_RowCount" select="count($Rows)"/>
        <xsl:variable name="dvt_RowCountMax" select="$dvt_RowCount"/>
        <xsl:variable name="IsEmpty" select="$dvt_RowCount = 0" />
        <xsl:variable name="dvt_IsEmpty" select="$dvt_RowCount = 0"/>

                <xsl:choose>
            <xsl:when test="$dvt_IsEmpty">
                <xsl:call-template name="dvt_1.empty"/>
            </xsl:when>
            <xsl:otherwise>
                <table border="0" width="100%">
                    <xsl:call-template name="dvt_1.body">
                        <xsl:with-param name="Rows" select="$Rows"/>
                        </xsl:call-template>
                        <xsl:copy-of select="$Rows"/>
                </table>
            </xsl:otherwise>
        </xsl:choose>
        </xsl:template>

    <xsl:template name="dvt_1.body">
        <xsl:param name="Rows"/>
        <xsl:for-each select="$Rows">

                    <xsl:call-template name="dvt_1.rowview" /></xsl:for-each>

    </xsl:template>
<!--HTML CLEANER TEMPLATE-->
                    <xsl:template name="removeHtmlTags">
                        <xsl:param name="html"/>
                        <xsl:choose>
                            <xsl:when test="contains($html, '&lt;')">
                        <xsl:value-of select="substring-before($html, '&lt;')"/>
                        <!-- Recurse through HTML -->
                                <xsl:call-template name="removeHtmlTags">
                                    <xsl:with-param name="html" select="substring-after($html, '&gt;')"/>
                                </xsl:call-template>
                      </xsl:when>
                            <xsl:otherwise>
                        <xsl:value-of select="$html"/>
                      </xsl:otherwise>
                        </xsl:choose>
          </xsl:template>

        <xsl:template name="dvt_1.rowview">

        <!-- Variable to remove HTML-->
            <xsl:variable name="pureText">
                <xsl:call-template name="removeHtmlTags">
                    <xsl:with-param name="html" select="@Body" />
                </xsl:call-template>
        </xsl:variable>
            <xsl:variable name="invalidchar" select="' .'" />
            <xsl:variable name="precate" select="translate(@Category.,' ','-')"/>
            <xsl:variable name="cate" select="translate($precate,'#;',' ')"/>
            <xsl:variable name="multicate" select="translate(@Category.,'#',' ')"/>
            <xsl:variable name="Title" select="translate(@Title,$invalidchar,'-')"/>
            <div class="project {$cate}">
                <div class="content">
                        <div class="image">
                            <a><img src="{@FileRef}" alt="image"/></a>
                            <div class="item-hover">
                            </div>
                        </div>
                        <h3 >
                            <a class="heading">
                                <xsl:value-of select="@Title" />
                            </a>
                        </h3>
                      <hr/>
                        <p class="price">
                            <xsl:value-of select="@Price" disable-output-escaping="yes"/>
                        </p>
                        <p class="description">
                            <xsl:value-of select="@_Comments" disable-output-escaping="yes"/>
                        </p>

                </div>
            </div>
                    <xsl:if test="$dvt_1_automode = '1'" ddwrt:cf_ignore="1">
                                <span ddwrt:amkeyfield="ID" ddwrt:amkeyvalue="ddwrt:EscapeDelims(string(@ID))" ddwrt:ammode="view"></span>
                    </xsl:if>


    </xsl:template>


    <xsl:template name="dvt_1.empty">
        <xsl:variable name="dvt_ViewEmptyText">There are no items to show in this view.</xsl:variable>
        <table border="0" width="100%">
            <tr>
                <td class="ms-vb">
                    <xsl:value-of select="$dvt_ViewEmptyText"/>
                </td>
            </tr>
        </table>
    </xsl:template>
    </xsl:stylesheet>   </XSL>



    </WebPartPages:DataFormWebPart>

</div>
</asp:Content>

All Products shows below, this is what Im trying to remove so it doesnt show until a category is clicked.

All Products (No Filter - Trying to remove this from page load)

0

This was used at the end of the page, just passed the piece of Javascript.

<div class="portfolioFilter text-center" >
                        <a href="#" style="display:none;" data-filter=".fakeCategory" id="Fake" class="current"><img src="../SiteAssets/all.jpg"/></a>  
                        <xsl:call-template name="dvt_1"/>


                <script type="text/javascript">
                _spBodyOnLoadFunctionNames.push("InitializePageCode");

                function InitializePageCode() {
                    document.getElementById("Fake").click();
                    document.getElementById("gallery").style.display = "block"; 
                    } 
                    </script>
</div>  

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.