• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 583
  • Last Modified:

Document Library Name (edit menu)

Hi experts!

I like to understand if it is possible that the "Name" of the document in the document library of SP2007 is not a hyperlink to the document.docx but I want it to be the link to the "View Item" dispform.aspx?ID=1

Not all the documents, but some of them only with categoty=process.

Would like to know how it can be done..

Thank you!
0
sharepoint2013
Asked:
sharepoint2013
  • 24
  • 19
1 Solution
 
Ingeborg Hawighorst (Microsoft MVP / EE MVE)Microsoft MVP ExcelCommented:
Hello,

I'm not sure that the List view can be modified to do this, but you can use SharePoint Designer to convert a List view to a Data View Web Part. You can then edit the XSL template for the row and use a hyperlink only when the condition is met.

cheers, teylyn
0
 
sharepoint2013Author Commented:
Sounds good! I have created the DVWP.

What do I look for and what do i change it to?
0
 
Ingeborg Hawighorst (Microsoft MVP / EE MVE)Microsoft MVP ExcelCommented:
Once you have created the DVWP, look for the template that starts with

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

Find the matching end tag and paste the whole tag with all the code into a reply here, then we can advise directly.

cheers, teylyn
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
sharepoint2013Author Commented:
The issue I mentioned earlier above is that... This library has different content types. Some are links to pages, some are documents...

I like this to be effected ONLY for those 'process' content types.
0
 
sharepoint2013Author Commented:
tey, btw thanks so much :)
0
 
Ingeborg Hawighorst (Microsoft MVP / EE MVE)Microsoft MVP ExcelCommented:
It's going on midnight here, so I'll get back to you in the morning.
0
 
sharepoint2013Author Commented:
no worries, thanks again tey!
0
 
Ingeborg Hawighorst (Microsoft MVP / EE MVE)Microsoft MVP ExcelCommented:
Hello,

you have not posted any XSL code yet. Did you manage to create a DVWP?

I have a document library with different content types. I created a DVWP that lists the columns ID, Category, and Title. The out of the box template for the row of the DVWP looks like this:

<xsl:template name="dvt_1.rowview">
		<tr>
			<xsl:if test="position() mod 2 = 1">
				<xsl:attribute name="class">ms-alternating</xsl:attribute>
			</xsl:if>
			<xsl:if test="$dvt_1_automode = '1'" ddwrt:cf_ignore="1">
				<td class="ms-vb" width="1%" nowrap="nowrap">
					<span ddwrt:amkeyfield="ID" ddwrt:amkeyvalue="ddwrt:EscapeDelims(string(@ID))" ddwrt:ammode="view"></span>
				</td>
			</xsl:if>
			<td class="ms-vb">
				<xsl:value-of select="@ID"/>
			</td>
			<td class="ms-vb">
				<xsl:value-of select="@ContentType"/>
			</td>
			<td class="ms-vb">
				<xsl:value-of select="@Title"/>
			</td>
		</tr>
	</xsl:template>

Open in new window


The code below has some modifications so that the title opens the Display form if the item has the category "Process". For all other categories, the title is a hyperlink to the actual document.

Note: you need to change the path to reflect your library path and name.

<xsl:template name="dvt_1.rowview">
		<tr>
			<xsl:if test="position() mod 2 = 1">
				<xsl:attribute name="class">ms-alternating</xsl:attribute>
			</xsl:if>
			<xsl:if test="$dvt_1_automode = '1'" ddwrt:cf_ignore="1">
				<td class="ms-vb" width="1%" nowrap="nowrap">
					<span ddwrt:amkeyfield="ID" ddwrt:amkeyvalue="ddwrt:EscapeDelims(string(@ID))" ddwrt:ammode="view" />
					
				</td>
			</xsl:if>
			<td class="ms-vb">
				<xsl:value-of select="@ID"/>
			</td>
			<td class="ms-vb">
				<xsl:value-of select="@Category"/>
			</td>
			<td class="ms-vb">
				<xsl:choose>
					<xsl:when test="@Category='Process'">
						<a href="http://SharePointSite/SubSite/LibraryName/Forms/DispForm.aspx?ID={@ID}">
							<xsl:value-of select="@Title"/>
						</a>
					</xsl:when>
					<xsl:otherwise>
						<a href="{@FileRef}">
							<xsl:value-of select="@Title"/>
						</a>					
					</xsl:otherwise>
				</xsl:choose>
				
			</td>
			</tr>
	</xsl:template>

Open in new window


cheers, teylyn
0
 
sharepoint2013Author Commented:
I need some help here, currently the below code shows all the files in 'process title' to link to the filename.

I only need those Content Type = Process, to link to their 'View Item link'

How do I do this?

<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="ListID">C389B00A-A485-4D28-84FE-F32360A763A0</xsl:param>
	<xsl:param name="Title" />
	<xsl:param name="Prod" />
	<xsl:param name="ProdGrp" />
	<xsl:param name="SubCat" />
	<xsl:param name="Channel" />
	<xsl:param name="sInt" >50</xsl:param>
	<xsl:param name="sID" >0</xsl:param>
	<xsl:param name="sfield" />
	<xsl:param name="sorder" />
	<xsl:param name="smallcase"></xsl:param>
	<xsl:param name="uppercase"></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:call-template name="dvt_1">
							<xsl:with-param name="sID" select="$sID"/>
							<xsl:with-param name="sInt" select="$sInt"/>
							<xsl:with-param name="sfield" select="$sfield"/>
							<xsl:with-param name="sorder" select="$sorder"/>

							</xsl:call-template>
	</xsl:template>
						
						<xsl:template name="dvt_1">
						<xsl:param name="sID"/>
						<xsl:param name="sInt"/>
						<xsl:param name="sfield"/>
						<xsl:param name="sorder"/>
						<xsl:variable name="pageLimit" select="number($sID) + number($sInt)"/><!--last page -->

						<xsl:variable name="dvt_StyleName">Table</xsl:variable>
						<xsl:variable name="Rows" select="/dsQueryResponse/Rows/Row[(contains(@Product_x0020_Group, $ProdGrp) or string-length($ProdGrp) = 0) and (contains(@Channel, $Channel) or string-length($Channel) = 0) and (contains(@Prodcut, $Prod) or string-length($Prod) = 0) and (@Cat_x0020_1 =$SubCat or string-length($SubCat) = 0) and (contains(translate(@FileLeafRef, $uppercase, $smallcase), translate($Title, $uppercase, $smallcase)) or string-length($Title) = 0)]"/>
						<xsl:variable name="dvt_RowCount" select="count($Rows)" />
						
							<xsl:if test="ddwrt:IfHasRights(4)"><div class="adminDiv">
						<a class="adminLink" href="../_layouts/Upload.aspx?List={ddwrt:UrlEncode(string($ListID))}" target="_blank">Add new item</a>
						</div></xsl:if>

						
						<xsl:call-template name="pagination">
						<xsl:with-param name="pageNumTotal" select="$dvt_RowCount"/>
						<xsl:with-param name="pageCur" select="$sID"/>
						<xsl:with-param name="pageLimit" select="$pageLimit"/>
						<xsl:with-param name="pageInv" select="$sInt"/>
						</xsl:call-template>

			<table width="100%" cellpadding="0" cellspacing="0" class="tblFilter">
			<thead>
			<tr valign="top">
				<th class="ms-vh" nowrap="">Rate</th>
				<th class="tshead" nowrap="">Process Title <img src="../system/styles/sort.gif" alt="" class="asc"/><img src="../system/styles/rsort.gif" alt="" class="desc"/><div class="divSort"><div class="divSortUp divSortUpDown" title="Title">Sort Ascending</div><div class="divSortDown divSortUpDown" title="Title">Sort Descending</div><div class="divClearSort">Clear</div></div></th><th class="tshead" nowrap="">Modified Date <img src="../system/styles/sort.gif" alt="" class="asc"/><img src="../system/styles/rsort.gif" alt="" class="desc"/><div class="divSort"><div class="divSortUp divSortUpDown" title="Modified">Sort Ascending</div><div class="divSortDown divSortUpDown" title="Modified">Sort Descending</div><div class="divClearSort">Clear</div></div></th><th class="tshead" nowrap="" width="1%"></th></tr></thead><tbody>
							<xsl:call-template name="dvt_1.body">
								<xsl:with-param name="Rows" select="$Rows"/>
								<xsl:with-param name="pageCur" select="$sID"/>
								<xsl:with-param name="pageLimit" select="$pageLimit"/>
								<xsl:with-param name="sfield" select="$sfield"/>
								<xsl:with-param name="sorder" select="$sorder"/>
		
									</xsl:call-template></tbody>
		</table><div id="bottomPaginate"></div>
							</xsl:template>
						<xsl:template name="dvt_1.body">
						<xsl:param name="Rows"/>
						<xsl:param name="pageCur"/>
						<xsl:param name="pageLimit"/>
						<xsl:param name="sfield"/>
						<xsl:param name="sorder"/>

							<xsl:choose>
							<xsl:when test="$sfield = 'Title'">
							<xsl:for-each select="$Rows">
							<xsl:sort select="@FileLeafRef" order="{$sorder}"/>
							<xsl:if test="(position() &gt; $pageCur) and (position() &lt;= $pageLimit)">
								<xsl:call-template name="dvt_1.rowview"/>
							</xsl:if>			
							</xsl:for-each>
							</xsl:when>
							
							<xsl:when test="$sfield = 'Modified'">
							<xsl:for-each select="$Rows">
							<xsl:sort select="@Modified" order="{$sorder}"/>
							<xsl:if test="(position() &gt; $pageCur) and (position() &lt;= $pageLimit)">
								<xsl:call-template name="dvt_1.rowview"/>
							</xsl:if>			
							</xsl:for-each>
							</xsl:when>
														
							<xsl:when test="$sfield = 'Editor'">
							<xsl:for-each select="$Rows">
							<xsl:sort select="@Editor" order="{$sorder}"/>
							<xsl:if test="(position() &gt; $pageCur) and (position() &lt;= $pageLimit)">
								<xsl:call-template name="dvt_1.rowview"/>
							</xsl:if>			
							</xsl:for-each>
							</xsl:when>
							
							<xsl:otherwise>
							<xsl:for-each select="$Rows">
							<xsl:if test="(position() &gt; $pageCur) and (position() &lt;= $pageLimit)">
								<xsl:call-template name="dvt_1.rowview"/>
							</xsl:if>
							</xsl:for-each>
							</xsl:otherwise>
							</xsl:choose>
		
	</xsl:template>
		<xsl:template name="dvt_1.rowview">
		<tr>
			<xsl:if test="position() mod 2 = 1">
				<xsl:attribute name="class">ms-alternating</xsl:attribute>
			</xsl:if>
			<td>
				<a href="{substring-before(@Rate, ', ')}">
					<xsl:value-of select="substring-after(@Rate, ', ')" />
				</a></td>
			<td>
				<a href="/{@FileDirRef}/{@FileLeafRef}" target="_blank">
				<xsl:value-of select="@FileLeafRef"/></a>
			</td><td>
				<xsl:value-of select="ddwrt:FormatDateTime(string(@Modified) ,1033 ,'dd-MMM-yy ')"/>
			</td><td width="1%">
				<xsl:if test="ddwrt:IfHasRights(4)">
				<a href="../{ddwrt:ListProperty('url')}/Forms/EditForm.aspx?ID={@ID}" target="_blank">Edit</a>
				</xsl:if>
			</td></tr>
	</xsl:template>
	
	<xsl:template name="pagination">
	<xsl:param name="pageNumTotal"/>
	<xsl:param name="pageCur"/>
	<xsl:param name="pageLimit"/>
	<xsl:param name="pageInv"/>
	<xsl:variable name="totalround" select="floor(number($pageNumTotal) div number($pageInv)) * number($pageInv)"/>
	<table class="tbltoolsPage" cellpadding="0" cellspacing="0">
	<tr>
	<td width="30%">
	<xsl:choose>
	<xsl:when test="$pageNumTotal != '0'">
	Showing entries <xsl:value-of select="$pageCur + 1"/><span class="curDiv" style="display:none"><xsl:value-of select="$pageCur"/></span> to 
	<xsl:choose>
	<xsl:when test="($pageCur + $pageInv) &gt; $pageNumTotal">
	<xsl:value-of select="$pageNumTotal"/>
	</xsl:when>
	<xsl:otherwise>
	<xsl:value-of select="$pageCur + $pageInv"/>
	</xsl:otherwise>
	</xsl:choose>
 	
 	
 	
 	
 	
 	
 	
 	
 	
 	
 	
 	
 	
 	
 	
 	of <span class="totalDiv"><xsl:value-of select="$pageNumTotal"/></span>
	<span class="invDiv"><xsl:value-of select="$pageInv"/></span>
	</xsl:when>
	<xsl:otherwise>
	No results found.
	</xsl:otherwise>
	</xsl:choose>
	</td>
	<td width="70%">
	<xsl:if test="$pageNumTotal != '0'">
	<div class="numConMain">
	<!-- use Jquery to populate the last link -->
	<div class="numLast"><a href="Process.aspx?sID={$totalround}">Last</a></div>
	<div class="numNext">Next</div>
	<div class="numCon"></div>
	<div class="numPrev">Prev</div>
	<div class="numFirst"><a href="Process.aspx?sID=0">First</a></div>
	</div>
	</xsl:if>
	</td></tr>
	</table>
	<table class="tblPageNumber">
	<tr><td colspan="2" class="pagenumber">
	Show: <select id="selPageNum">
	<option value="50">50</option>
	<option value="100">
	100</option>
	<option value="150">150</option>
	<option value="200">200</option>
	<option value="{ceiling(number($pageNumTotal) div 10) * 10}">
	Everything</option>
	</select>
	</td></tr>
	</table>
	</xsl:template></xsl:stylesheet>

Open in new window

0
 
sharepoint2013Author Commented:
it's actually not category=process, sorry. i made a mistake.

it is content type = process

i created a new content type for this.
0
 
Ingeborg Hawighorst (Microsoft MVP / EE MVE)Microsoft MVP ExcelCommented:
Here is the changed template

<xsl:template name="dvt_1.rowview">
		<tr>
			<xsl:if test="position() mod 2 = 1">
				<xsl:attribute name="class">ms-alternating</xsl:attribute>
			</xsl:if>
			<td>
				<a href="{substring-before(@Rate, ', ')}">
					<xsl:value-of select="substring-after(@Rate, ', ')" />
				</a></td>
			<td>
				<xsl:choose>
					<xsl:when test="@ContentType='Process'">
						<a href="http://YourSite/YourSubSite/YourLibrary/Forms/DispForm.aspx?ID={@ID}">
							<xsl:value-of select="@Title"/>
						</a>
					</xsl:when>
					<xsl:otherwise>
						<a href="/{@FileDirRef}/{@FileLeafRef}" target="_blank">
				<xsl:value-of select="@FileLeafRef"/></a>					
					</xsl:otherwise>
				</xsl:choose>
			</td>
			<td>
				<xsl:value-of select="ddwrt:FormatDateTime(string(@Modified) ,1033 ,'dd-MMM-yy ')"/>
			</td><td width="1%">
				<xsl:if test="ddwrt:IfHasRights(4)">
				<a href="../{ddwrt:ListProperty('url')}/Forms/EditForm.aspx?ID={@ID}" target="_blank">Edit</a>
				</xsl:if>
			</td></tr>
	</xsl:template>

Open in new window


Replace the tag <xsl:template name="dvt_1.rowview"> and its matching end tag with this code.

cheers, teylyn
0
 
sharepoint2013Author Commented:
Oh dear, the items with Content Type = Process appear with modified date...

BUT the Process Title shows empty, hence there there is no title nor link.

The other items are fine

<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="ListID">C389B00A-A485-4D28-84FE-F32360A763A0</xsl:param>
	<xsl:param name="Title" />
	<xsl:param name="Prod" />
	<xsl:param name="ProdGrp" />
	<xsl:param name="SubCat" />
	<xsl:param name="Channel" />
	<xsl:param name="sInt" >50</xsl:param>
	<xsl:param name="sID" >0</xsl:param>
	<xsl:param name="sfield" />
	<xsl:param name="sorder" />
	<xsl:param name="smallcase"></xsl:param>
	<xsl:param name="uppercase"></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:call-template name="dvt_1">
							<xsl:with-param name="sID" select="$sID"/>
							<xsl:with-param name="sInt" select="$sInt"/>
							<xsl:with-param name="sfield" select="$sfield"/>
							<xsl:with-param name="sorder" select="$sorder"/>

							</xsl:call-template>
	</xsl:template>
						
						<xsl:template name="dvt_1">
						<xsl:param name="sID"/>
						<xsl:param name="sInt"/>
						<xsl:param name="sfield"/>
						<xsl:param name="sorder"/>
						<xsl:variable name="pageLimit" select="number($sID) + number($sInt)"/><!--last page -->

						<xsl:variable name="dvt_StyleName">Table</xsl:variable>
						<xsl:variable name="Rows" select="/dsQueryResponse/Rows/Row[(contains(@Product_x0020_Group, $ProdGrp) or string-length($ProdGrp) = 0) and (contains(@Channel, $Channel) or string-length($Channel) = 0) and (contains(@Prodcut, $Prod) or string-length($Prod) = 0) and (@Cat_x0020_1 =$SubCat or string-length($SubCat) = 0) and (contains(translate(@FileLeafRef, $uppercase, $smallcase), translate($Title, $uppercase, $smallcase)) or string-length($Title) = 0)]"/>
						<xsl:variable name="dvt_RowCount" select="count($Rows)" />
						
							<xsl:if test="ddwrt:IfHasRights(4)"><div class="adminDiv">
						<a class="adminLink" href="../_layouts/Upload.aspx?List={ddwrt:UrlEncode(string($ListID))}" target="_blank">Add new item</a>
						</div></xsl:if>

						
						<xsl:call-template name="pagination">
						<xsl:with-param name="pageNumTotal" select="$dvt_RowCount"/>
						<xsl:with-param name="pageCur" select="$sID"/>
						<xsl:with-param name="pageLimit" select="$pageLimit"/>
						<xsl:with-param name="pageInv" select="$sInt"/>
						</xsl:call-template>

			<table width="100%" cellpadding="0" cellspacing="0" class="tblFilter">
			<thead>
			<tr valign="top">
				<th class="ms-vh" nowrap="">Rate</th>
				<th class="tshead" nowrap="">Process Title <img src="../system/styles/sort.gif" alt="" class="asc"/><img src="../system/styles/rsort.gif" alt="" class="desc"/><div class="divSort"><div class="divSortUp divSortUpDown" title="Title">Sort Ascending</div><div class="divSortDown divSortUpDown" title="Title">Sort Descending</div><div class="divClearSort">Clear</div></div></th><th class="tshead" nowrap="">Modified Date <img src="../system/styles/sort.gif" alt="" class="asc"/><img src="../system/styles/rsort.gif" alt="" class="desc"/><div class="divSort"><div class="divSortUp divSortUpDown" title="Modified">Sort Ascending</div><div class="divSortDown divSortUpDown" title="Modified">Sort Descending</div><div class="divClearSort">Clear</div></div></th><th class="tshead" nowrap="" width="1%"></th></tr></thead><tbody>
							<xsl:call-template name="dvt_1.body">
								<xsl:with-param name="Rows" select="$Rows"/>
								<xsl:with-param name="pageCur" select="$sID"/>
								<xsl:with-param name="pageLimit" select="$pageLimit"/>
								<xsl:with-param name="sfield" select="$sfield"/>
								<xsl:with-param name="sorder" select="$sorder"/>
		
									</xsl:call-template></tbody>
		</table><div id="bottomPaginate"></div>
							</xsl:template>
						<xsl:template name="dvt_1.body">
						<xsl:param name="Rows"/>
						<xsl:param name="pageCur"/>
						<xsl:param name="pageLimit"/>
						<xsl:param name="sfield"/>
						<xsl:param name="sorder"/>

							<xsl:choose>
							<xsl:when test="$sfield = 'Title'">
							<xsl:for-each select="$Rows">
							<xsl:sort select="@FileLeafRef" order="{$sorder}"/>
							<xsl:if test="(position() &gt; $pageCur) and (position() &lt;= $pageLimit)">
								<xsl:call-template name="dvt_1.rowview"/>
							</xsl:if>			
							</xsl:for-each>
							</xsl:when>
							
							<xsl:when test="$sfield = 'Modified'">
							<xsl:for-each select="$Rows">
							<xsl:sort select="@Modified" order="{$sorder}"/>
							<xsl:if test="(position() &gt; $pageCur) and (position() &lt;= $pageLimit)">
								<xsl:call-template name="dvt_1.rowview"/>
							</xsl:if>			
							</xsl:for-each>
							</xsl:when>
														
							<xsl:when test="$sfield = 'Editor'">
							<xsl:for-each select="$Rows">
							<xsl:sort select="@Editor" order="{$sorder}"/>
							<xsl:if test="(position() &gt; $pageCur) and (position() &lt;= $pageLimit)">
								<xsl:call-template name="dvt_1.rowview"/>
							</xsl:if>			
							</xsl:for-each>
							</xsl:when>
							
							<xsl:otherwise>
							<xsl:for-each select="$Rows">
							<xsl:if test="(position() &gt; $pageCur) and (position() &lt;= $pageLimit)">
								<xsl:call-template name="dvt_1.rowview"/>
							</xsl:if>
							</xsl:for-each>
							</xsl:otherwise>
							</xsl:choose>
		
	</xsl:template>
		
	<xsl:template name="dvt_1.rowview">
		<tr>
			<xsl:if test="position() mod 2 = 1">
				<xsl:attribute name="class">ms-alternating</xsl:attribute>
			</xsl:if>
			<td>
				<a href="{substring-before(@Rate, ', ')}">
					<xsl:value-of select="substring-after(@Rate, ', ')" />
				</a></td>
			<td>
				<xsl:choose>
					<xsl:when test="@ContentType='Process'">
						<a href="http://YourSite/YourSubSite/YourLibrary/Forms/DispForm.aspx?ID={@ID}">
							<xsl:value-of select="@Title"/>
						</a>
					</xsl:when>
					<xsl:otherwise>
						<a href="/{@FileDirRef}/{@FileLeafRef}" target="_blank">
				<xsl:value-of select="@FileLeafRef"/></a>					
					</xsl:otherwise>
				</xsl:choose>
			</td>
			<td>
				<xsl:value-of select="ddwrt:FormatDateTime(string(@Modified) ,1033 ,'dd-MMM-yy ')"/>
			</td><td width="1%">
				<xsl:if test="ddwrt:IfHasRights(4)">
				<a href="../{ddwrt:ListProperty('url')}/Forms/EditForm.aspx?ID={@ID}" target="_blank">Edit</a>
				</xsl:if>
			</td></tr>
	</xsl:template>	
	<xsl:template name="pagination">
	<xsl:param name="pageNumTotal"/>
	<xsl:param name="pageCur"/>
	<xsl:param name="pageLimit"/>
	<xsl:param name="pageInv"/>
	<xsl:variable name="totalround" select="floor(number($pageNumTotal) div number($pageInv)) * number($pageInv)"/>
	<table class="tbltoolsPage" cellpadding="0" cellspacing="0">
	<tr>
	<td width="30%">
	<xsl:choose>
	<xsl:when test="$pageNumTotal != '0'">
	Showing entries <xsl:value-of select="$pageCur + 1"/><span class="curDiv" style="display:none"><xsl:value-of select="$pageCur"/></span> to 
	<xsl:choose>
	<xsl:when test="($pageCur + $pageInv) &gt; $pageNumTotal">
	<xsl:value-of select="$pageNumTotal"/>
	</xsl:when>
	<xsl:otherwise>
	<xsl:value-of select="$pageCur + $pageInv"/>
	</xsl:otherwise>
	</xsl:choose>
 	
 	
 	
 	
 	
 	
 	
 	
 	
 	
 	
 	
 	
 	
 	
 	of <span class="totalDiv"><xsl:value-of select="$pageNumTotal"/></span>
	<span class="invDiv"><xsl:value-of select="$pageInv"/></span>
	</xsl:when>
	<xsl:otherwise>
	No results found.
	</xsl:otherwise>
	</xsl:choose>
	</td>
	<td width="70%">
	<xsl:if test="$pageNumTotal != '0'">
	<div class="numConMain">
	<!-- use Jquery to populate the last link -->
	<div class="numLast"><a href="Process.aspx?sID={$totalround}">Last</a></div>
	<div class="numNext">Next</div>
	<div class="numCon"></div>
	<div class="numPrev">Prev</div>
	<div class="numFirst"><a href="Process.aspx?sID=0">First</a></div>
	</div>
	</xsl:if>
	</td></tr>
	</table>
	<table class="tblPageNumber">
	<tr><td colspan="2" class="pagenumber">
	Show: <select id="selPageNum">
	<option value="50">50</option>
	<option value="100">
	100</option>
	<option value="150">150</option>
	<option value="200">200</option>
	<option value="{ceiling(number($pageNumTotal) div 10) * 10}">
	Everything</option>
	</select>
	</td></tr>
	</table>
	</xsl:template></xsl:stylesheet>

Open in new window

0
 
sharepoint2013Author Commented:
teylyn, would you know where went wrong? the items show up but the process title is blank
0
 
sharepoint2013Author Commented:
teylyn, you there?
0
 
Ingeborg Hawighorst (Microsoft MVP / EE MVE)Microsoft MVP ExcelCommented:
Check your data. The code works fine on my library.

Do all items in the library have the Title field filled in?

Build another test list or library and try on that. There is no reason why the date should change when there is no title, or why a title would not show if it is there.

Did you adjust the path to the library in the code to point to your library?
Does the code work if you use another field but "Title" as the link?

Play around with some of the parameters to troubleshoot.

cheers, teylyn
0
 
sharepoint2013Author Commented:
I just tried it and nothing showed up, see the screen.png.

I attached my page.aspx code here too!
page.txt
screen.png
0
 
sharepoint2013Author Commented:
Process title is empty :(
0
 
Ingeborg Hawighorst (Microsoft MVP / EE MVE)Microsoft MVP ExcelCommented:
The text file with the html does not help much. It would be better to post your DVWP xsl from SharePoint Designer

Also, please post a screenshot of a view of the library with a few records that are Process and non-Process records. The view should include all the columns that you use in the DVWP, i.e. Title, Content Type, etc.
0
 
Ingeborg Hawighorst (Microsoft MVP / EE MVE)Microsoft MVP ExcelCommented:
Looking at the XSL you posted above: You did not change the path to the library. That will never fly. You need to adjust the path to the library!!!

<td>
                        <xsl:choose>
                              <xsl:when test="@ContentType='Process'">
                                    <a href="http://YourSite/YourSubSite/YourLibrary/Forms/DispForm.aspx?ID={@ID}">
                                          <xsl:value-of select="@Title"/>
                                    </a>
                              </xsl:when>
                              <xsl:otherwise>
                                    <a href="/{@FileDirRef}/{@FileLeafRef}" target="_blank">
                        <xsl:value-of select="@FileLeafRef"/></a>                              
                              </xsl:otherwise>
                        </xsl:choose>
                  </td>
0
 
sharepoint2013Author Commented:
Hey teylyn, i did change it! not sure why it still showed up the old copy.

Here's my full SP designer code and the screenshot.

Thanks!
screen.pptx
page.aspx
0
 
Ingeborg Hawighorst (Microsoft MVP / EE MVE)Microsoft MVP ExcelCommented:
I'd like to see a screenshot of a list view. The original browser interface when you navigate to the library. I'd like to see in the screenshot the columns for Title and Content type, including the column headers. And I'd like to see the URL in the screenshot.

Can you post that?
0
 
sharepoint2013Author Commented:
Thanks teylyn

Here you go
screen2.pptx
0
 
Ingeborg Hawighorst (Microsoft MVP / EE MVE)Microsoft MVP ExcelCommented:
if this is the path to your library

http://k1.zone1.company.net/sites/sg/k1_sg/Pro/Forms/All%20Process.aspx

... please take another look at the path in your code, which reads

http://k1.zone1.company.net/sites/sg/k1_sg/page/Forms/DispForm.aspx?ID={@I}

Take out the page bit and test the DVWP.
0
 
Ingeborg Hawighorst (Microsoft MVP / EE MVE)Microsoft MVP ExcelCommented:
I assume that the "page" may be a folder in the library. But when you build the link address for the item using the ID, you want the path to the Forms, which is right after the library name

http://SiteName/LibraryName/Forms/DispForm.aspx

and not

http://SiteName/LibraryName/Folder/Forms/DispForm.aspx
0
 
sharepoint2013Author Commented:
I changed it to http://k1.zone1.company.net/sites/sg/k1_sg/Pro/Forms/DispForm.......

But the title is still empty :(
0
 
Ingeborg Hawighorst (Microsoft MVP / EE MVE)Microsoft MVP ExcelCommented:
As I asked above (twice) please post a screenshot of a listview that shows the Title column and the Content Type column.

In the last screenshot these two were not included. Did you check if the title field actually has content for these records? Show me a screenshot where I can see that they do and what the content type is.
0
 
Ingeborg Hawighorst (Microsoft MVP / EE MVE)Microsoft MVP ExcelCommented:
And while you're at it, please make sure that the screenshot includes the URL.
0
 
sharepoint2013Author Commented:
Sorry here it is. I missed it out
screen3.png
0
 
Ingeborg Hawighorst (Microsoft MVP / EE MVE)Microsoft MVP ExcelCommented:
I don't see the Title column. Can you include it, please?

We're using the Title column in the DVWP as the anchor text for the link. I would like to see if it actually has data. If not, there's no point in using it. If Title is blank, that would be the perfect explanation why the hyperlink in the DVWP does not show. It has no anchor text.
0
 
sharepoint2013Author Commented:
In the "edit view" there is no Title column, but only Name
0
 
sharepoint2013Author Commented:
I understand this, but then why is the other items showing this the code:

<xsl:template name="dvt_1.rowview">
		<tr>
			<xsl:if test="position() mod 2 = 1">
				<xsl:attribute name="class">ms-alternating</xsl:attribute>
			</xsl:if>
			<td>
				<a href="{substring-before(@Rate, ', ')}">
					<xsl:value-of select="substring-after(@Rate, ', ')" />
				</a></td>
			<td>
				<a href="/{@FileDirRef}/{@FileLeafRef}" target="_blank">
				<xsl:value-of select="@FileLeafRef"/></a>
			</td><td>
				<xsl:value-of select="ddwrt:FormatDateTime(string(@Modified) ,1033 ,'dd-MMM-yy ')"/>
			</td><td width="1%">
				<xsl:if test="ddwrt:IfHasRights(4)">
				<a href="../{ddwrt:ListProperty('url')}/Forms/EditForm.aspx?ID={@ID}" target="_blank">Edit</a>
				</xsl:if>
			</td></tr>
	</xsl:template>

Open in new window

0
 
Ingeborg Hawighorst (Microsoft MVP / EE MVE)Microsoft MVP ExcelCommented:
Try swapping out the @Title for @FileLeafRef.Name like this:

<xsl:template name="dvt_1.rowview">
            <tr>
                  <xsl:if test="position() mod 2 = 1">
                        <xsl:attribute name="class">ms-alternating</xsl:attribute>
                  </xsl:if>
                  <td>
                        <a href="{substring-before(@Rate, ', ')}">
                              <xsl:value-of select="substring-after(@Rate, ', ')" />
                        </a></td>
                  <td>
                        <xsl:choose>
                              <xsl:when test="@ContentType='Process'">
                                    <a href="http://k1.zone1.company.net/sites/sg/k1_sg/page/Forms/DispForm.aspx?ID={@ID}">
                                          <xsl:value-of select="@FileLeafRef.Name"/>
                                    </a>
                              </xsl:when>
                              <xsl:otherwise>
                                    <a href="/{@FileDirRef}/{@FileLeafRef}" target="_blank">
                        <xsl:value-of select="@FileLeafRef"/></a>                              
                              </xsl:otherwise>
                        </xsl:choose>
                  </td>
                  <td>
                        <xsl:value-of select="ddwrt:FormatDateTime(string(@Modified) ,1033 ,'dd-MMM-yy ')"/>
                  </td><td width="1%">
                        <xsl:if test="ddwrt:IfHasRights(4)">
                        <a href="../{ddwrt:ListProperty('url')}/Forms/EditForm.aspx?ID={@ID}" target="_blank">Edit</a>
                        </xsl:if>
                  </td></tr>
      </xsl:template>

Please do NOT do a global find and replace, only the @Title in the xsl:choose tag.
0
 
Ingeborg Hawighorst (Microsoft MVP / EE MVE)Microsoft MVP ExcelCommented:
The other records are showing because they are using the @FileLeafRef, not the @Title.
0
 
sharepoint2013Author Commented:
still empty :(

<xsl:template name="dvt_1.rowview">
            <tr>
                  <xsl:if test="position() mod 2 = 1">
                        <xsl:attribute name="class">ms-alternating</xsl:attribute>
                  </xsl:if>
                  <td>
                        <a href="{substring-before(@Rate, ', ')}">
                              <xsl:value-of select="substring-after(@Rate, ', ')" />
                        </a></td>
                  <td>
                        <xsl:choose>
                              <xsl:when test="@ContentType='Process'">
                                    <a href="http://k1.zone1.company.net/sites/sg/k1_sg/Pro/Forms/DispForm.aspx?ID={@ID}">
                                          <xsl:value-of select="@FileLeafRef.Name"/>
                                    </a>
                              </xsl:when>
                              <xsl:otherwise>
                                    <a href="/{@FileDirRef}/{@FileLeafRef}" target="_blank">
                        <xsl:value-of select="@FileLeafRef"/></a>                              
                              </xsl:otherwise>
                        </xsl:choose>
                  </td>
                  <td>
                        <xsl:value-of select="ddwrt:FormatDateTime(string(@Modified) ,1033 ,'dd-MMM-yy ')"/>
                  </td><td width="1%">
                        <xsl:if test="ddwrt:IfHasRights(4)">
                        <a href="../{ddwrt:ListProperty('url')}/Forms/EditForm.aspx?ID={@ID}" target="_blank">Edit</a>
                        </xsl:if>
                  </td></tr>
      </xsl:template>

Open in new window

0
 
sharepoint2013Author Commented:
Ok i changed FileLeafRef.Name to FileLeafRef and it works!
0
 
Ingeborg Hawighorst (Microsoft MVP / EE MVE)Microsoft MVP ExcelCommented:
That would have been my next try. I'm testing on a doc lib with all files and title column filled in. FileLeafRef gives you the name with the extension ( if it's a file ) and FileLeafRef.Name omits the file extension. But apparently that only works with files, as you have found out.

Glad you got it working.
0
 
sharepoint2013Author Commented:
You are amazing :)
0
 
sharepoint2013Author Commented:
Can I just ask a last question.. Hope it is okay.. When I put this URL ---> it does not work, with a webpart error:

href="http://k1.zone1.company.net/sites/sg/k1_sg/Pro/Forms/DispForm.aspx?ID={@ID}&Source=http://k1.zone1.company.net/sites/sg/k1_sg/Pro/Forms/AllItems.aspx"
0
 
Ingeborg Hawighorst (Microsoft MVP / EE MVE)Microsoft MVP ExcelCommented:
What are you trying to do? Why do you append something to the link that opens the display form for the item?
0
 
sharepoint2013Author Commented:
theres customizations on the page that requires me to add this behind.
0
 
sharepoint2013Author Commented:
teylyn?
0
 
Ingeborg Hawighorst (Microsoft MVP / EE MVE)Microsoft MVP ExcelCommented:
I'm not sure I understand what you mean. How about you open a new question about that?
0

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

  • 24
  • 19
Tackle projects and never again get stuck behind a technical roadblock.
Join Now