<WebPartPages:DataFormWebPart runat="server" ShowWithSampleData="False" AllowRemove="True" AllowHide="True" SuppressWebPartChrome="False" PartImageLarge="" ViewContentTypeId="" ExportMode="All" Dir="Default" MissingAssembly="Cannot import this Web Part." ID="g_c7ec8e24_ff10_46f1_936c_0daf5cc44068" DataSourceID="" IsIncludedFilter="" DetailLink="" AllowEdit="True" UseSQLDataSourcePaging="True" HelpMode="Modeless" IsIncluded="True" Description="" NoDefaultStyle="TRUE" FrameState="Normal" AllowConnect="True" ViewFlag="0" AllowZoneChange="True" AllowMinimize="True" Title="Advertisements" PartOrder="1" PageSize="-1" FrameType="None" HelpLink="" PartImageSmall="" ConnectionID="00000000-0000-0000-0000-000000000000" ExportControlledProperties="True" ChromeType="None" IsVisible="True" __MarkupType="vsattributemarkup" __WebPartId="{C7EC8E24-FF10-46F1-936C-0DAF5CC44068}" __AllowXSLTEditing="true" WebPart="true" Height="" Width=""><ParameterBindings>
<ParameterBinding Name="ListName" Location="None" DefaultValue="Advertisements"/>
<ParameterBinding Name="WebURL" Location="None" DefaultValue="/Subsite/"/>
<ParameterBinding Name="dvt_apos" Location="Postback;Connection"/>
<ParameterBinding Name="UserID" Location="CAMLVariable" DefaultValue="CurrentUserName"/>
<ParameterBinding Name="Today" Location="CAMLVariable" DefaultValue="CurrentDate"/>
</ParameterBindings>
<DataFields>
@Title,Title;@Brochure_x0020_Text,Brochure Text;@Brochure_x0020_Image,Brochure Image;@ID,ID;@ContentType,Content Type;@Modified,Modified;@Created,Created;@Author,Created By;@Editor,Modified By;@_UIVersionString,Version;@Attachments,Attachments;@File_x0020_Type,File Type;@FileLeafRef,Name (for use in forms);@FileDirRef,Path;@FSObjType,Item Type;@_HasCopyDestinations,Has Copy Destinations;@_CopySource,Copy Source;@ContentTypeId,Content Type ID;@_ModerationStatus,Approval Status;@_UIVersion,UI Version;@Created_x0020_Date,Created;@FileRef,URL Path;</DataFields>
<DataSources>
<SharePointWebControls:SPDataSource runat="server" DataSourceMode="List" SelectCommand="<View></View>" UseInternalName="True" ID="dataformwebpart2"><SelectParameters><WebPartPages:DataFormParameter ParameterKey="ListName" PropertyName="ParameterValues" DefaultValue="Advertisements" Name="ListName"></WebPartPages:DataFormParameter><WebPartPages:DataFormParameter ParameterKey="WebURL" PropertyName="ParameterValues" DefaultValue="/Subsite/" Name="WebURL"></WebPartPages:DataFormParameter>
</SelectParameters><UpdateParameters><WebPartPages:DataFormParameter ParameterKey="ListID" PropertyName="ParameterValues" DefaultValue="EBBDF8F7-7651-419E-8139-E6E02821AB2D" Name="ListID"></WebPartPages:DataFormParameter>
</UpdateParameters><InsertParameters><WebPartPages:DataFormParameter ParameterKey="ListID" PropertyName="ParameterValues" DefaultValue="EBBDF8F7-7651-419E-8139-E6E02821AB2D" Name="ListID"></WebPartPages:DataFormParameter>
</InsertParameters><DeleteParameters><WebPartPages:DataFormParameter ParameterKey="ListID" PropertyName="ParameterValues" DefaultValue="EBBDF8F7-7651-419E-8139-E6E02821AB2D" Name="ListID"></WebPartPages:DataFormParameter>
</DeleteParameters>
</SharePointWebControls:SPDataSource>
</DataSources>
<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">'</xsl:param>
<xsl:variable name="dvt_1_automode">0</xsl:variable>
<xsl:template match="/">
<xsl:call-template name="dvt_1"/>
</xsl:template>
<xsl:template name="dvt_1">
<xsl:variable name="dvt_StyleName">Table</xsl:variable>
<xsl:variable name="Rows" select="/dsQueryResponse/Rows/Row"/>
<table border="0" width="100%" cellpadding="2" cellspacing="0">
<tr valign="top" style="visibility:hidden">
<xsl:if test="$dvt_1_automode = '1'" ddwrt:cf_ignore="1">
<th width="1%" nowrap="nowrap"></th>
</xsl:if>
<th class="ms-vh" style="visibility:hidden; width: 146px;" nowrap="">Advertisements Image</th>
<th class="ms-vh" style="visibility:hidden" nowrap="">Title</th>
<th class="ms-vh" style="visibility:hidden" nowrap="">Advertisements Text</th>
</tr>
<xsl:call-template name="dvt_1.body">
<xsl:with-param name="Rows" select="$Rows"/>
</xsl:call-template>
</table>
</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">
<tr style="border-bottom:1px;border-bottom-color:grey;">
<xsl:if test="position() mod 2 = 1">
<xsl:attribute name="class">ms-alternating12345</xsl:attribute>
</xsl:if>
<xsl:if test="$dvt_1_automode = '1'" ddwrt:cf_ignore="1">
<td width="1%" nowrap="nowrap">
<span ddwrt:amkeyfield="ID" ddwrt:amkeyvalue="ddwrt:EscapeDelims(string(@ID))" ddwrt:ammode="view"></span>
</td>
</xsl:if>
<td style="width: 146px;padding-bottom:8px;" >
<img border="0" src="{substring-before(@Advertisements_x0020_Image, ', ')}" alt="{substring-after(@Advertisements_x0020_Image, ', ')}"/>
</td>
<td colspan="2" valign="top">
<table>
<tr><td colspan="2"><strong><xsl:value-of select="@Title" /></strong></td></tr>
<tr><td colspan="2"><xsl:value-of select="@Advertisements_x0020_Text" disable-output-escaping="yes"/>
<xsl:element name="SharePoint:AttachmentsField">
<xsl:attribute name="runat">server</xsl:attribute>
<xsl:attribute name="FieldName">Attachments</xsl:attribute>
<xsl:attribute name="Visible">true</xsl:attribute>
<xsl:attribute name="ItemId">
<xsl:value-of select="@ID"/>
</xsl:attribute>
</xsl:element>
</td></tr>
</table>
</td>
</tr>
</xsl:template>
</xsl:stylesheet></Xsl>
</WebPartPages:DataFormWebPart>
Note: Instead of ListID use ListName
Note: WebURL : Instead of {sitecollectionroot} use / or /Subsite/
Note: Create the Lists in Subsite if we want to work with Attachements
Instead of:
<SharePoint:AttachmentButton ControlMode="Edit" Enabled="true" ItemId="{@ID}" runat="server" Visible="false"/>
<SharePoint:AttachmentsField ControlMode="Display" ItemId="{@ID}" EnableViewState="true" FieldName="Attachments" runat="server"/>
Use:
<xsl:element name="SharePoint:AttachmentsField">
<xsl:attribute name="runat">server</xsl:attribute>
<xsl:attribute name="FieldName">Attachments</xsl:attribute>
<xsl:attribute name="Visible">true</xsl:attribute>
<xsl:attribute name="ItemId">
<xsl:value-of select="@ID"/>
</xsl:attribute>
</xsl:element>
Note: Both are Same when rendered but first one works nicely when we have lists is Root. When We have Lists in Subsite go with the second option along with changing the ListName and WebURL attributes.
Subscribe to:
Post Comments (Atom)
SonarQube with Jenkins Setup using Docker Images
https://funnelgarden.com/sonarqube-jenkins-docker/ https://medium.com/@hakdogan/an-end-to-end-tutorial-to-continuous-integration-and-con...
-
Happy New Year. May this year is the year for your dreams, passions, everything you believe, your wishes, your desires, your thoughts, your ...
-
The competitive examination for the Indian Forest Service is conducted by Union Public Service Commission (UPSC). IFS exam is conducted ann...
-
Azure Mobile App Service provides services that allow you to support mobile apps across multiple platforms. It does not provide hosting ser...
No comments:
Post a Comment