Office Listings Getting the Data View Looking Right – The Office Listings was implemented a Data View, customized through SharePoint Designer. There are several benefits to using the data view including: Data source options such as SharePoint lists, web services, databases or XML Filtering, grouping and paging of data Viewing of individual items or multiple items in table format Part 1 Creating the List – The office listings consisted of about 200 records. We decided to store the office listings information in a SharePoint list. This provides easy editing by the content editors and is the least work for a developer. Beyond the standard fields such as address and phone number, we included a Boolean field that allowed content editors to toggle whether a specific offices contact details were “Show” displayed. Part 2 Getting the Grouping Right – In the Data View we took advantage of the grouping and filtering options. A filter was applied to only show records that had set to true, and grouping was applied to the Region and Country “Show” options to create the following effect: Figure: There are two levels of grouping Region and Country – Part 3 Getting the Anchor Tags Right – The final requirement that had to be satisfied was the addition of anchor tags to regions, countries and individual offices. The Data View web part embeds the XSL style sheets into the web part so this could be directly manipulated to create anchor tags around each element. To apply this to the two group headers (region and country), find the following text for each group header tag e.g. <xsl:template Then add the following code within the first <td> tag of the group header: <a> <xsl:attribute name="name"> <xsl:value-of select="translate(normalize-space($alinkRegion), ' ','')" /> </xsl:attribute> </a> XSLT functions and were used to manipulate the names of the offices, “translate” “normalize-space” countries and regions.
Office Listings – Getting the Data View Looking Right The Office Listings was implemented a Data View, customized through SharePoint Designer. There are several benefits to using the data view including: Data source options such as SharePoint lists, web services, databases or XML Filtering, grouping and paging of data Viewing of individual items or multiple items in table format Part 1 – Creating the List The office listings consisted of about 200 records. We decided to store the office listings information in a SharePoint list. This provides easy editing by the content editors and is the least work for a developer. Beyond the standard fields such as address and phone number, we included a Boolean “Show” field that allowed content editors to toggle whether a specific offices contact details were displayed. Part 2 – Getting the Grouping Right In the Data View we took advantage of the grouping and filtering options. A filter was applied to only show records that had “Show” set to true, and grouping was applied to the Region and Country options to create the following effect: Figure: There are two levels of grouping – Region and Country Part 3 – Getting the Anchor Tags Right The final requirement that had to be satisfied was the addition of anchor tags to regions, countries and individual offices. The Data View web part embeds the XSL style sheets into the web part so this could be directly manipulated to create anchor tags around each element. To apply this to the two group headers (region and country), find the following text for each group header tag e.g. <xsl:template Then add the following code within the first <td> tag of the group header: <a> <xsl:attribute name="name"> <xsl:value-of select="translate(normalize-space($alinkRegion), ' ','')" /> </xsl:attribute> </a> XSLT functions “translate” and “normalize-space” were used to manipulate the names of the offices, countries and regions.
WorleyParsons_PuttingStyleIntoYourWebParts_v3.docx