Solved

Document Library Name (edit menu)

Posted on 2013-01-23
43
516 Views
Last Modified: 2013-01-29
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
Comment
Question by:sharepoint2013
  • 24
  • 19
43 Comments
 
LVL 50

Expert Comment

by:teylyn
ID: 38808918
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
 

Author Comment

by:sharepoint2013
ID: 38808934
Sounds good! I have created the DVWP.

What do I look for and what do i change it to?
0
 
LVL 50

Expert Comment

by:teylyn
ID: 38808983
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
 

Author Comment

by:sharepoint2013
ID: 38809037
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
 

Author Comment

by:sharepoint2013
ID: 38809039
tey, btw thanks so much :)
0
 
LVL 50

Expert Comment

by:teylyn
ID: 38809043
It's going on midnight here, so I'll get back to you in the morning.
0
 

Author Comment

by:sharepoint2013
ID: 38810649
no worries, thanks again tey!
0
 
LVL 50

Expert Comment

by:teylyn
ID: 38812594
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
 

Author Comment

by:sharepoint2013
ID: 38815476
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
 

Author Comment

by:sharepoint2013
ID: 38817073
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
 
LVL 50

Expert Comment

by:teylyn
ID: 38817339
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
 

Author Comment

by:sharepoint2013
ID: 38817378
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
 

Author Comment

by:sharepoint2013
ID: 38819657
teylyn, would you know where went wrong? the items show up but the process title is blank
0
 

Author Comment

by:sharepoint2013
ID: 38824335
teylyn, you there?
0
 
LVL 50

Expert Comment

by:teylyn
ID: 38824634
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
 

Author Comment

by:sharepoint2013
ID: 38827110
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
 

Author Comment

by:sharepoint2013
ID: 38827115
Process title is empty :(
0
 
LVL 50

Expert Comment

by:teylyn
ID: 38828709
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
 
LVL 50

Expert Comment

by:teylyn
ID: 38828729
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
 

Author Comment

by:sharepoint2013
ID: 38829578
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
 
LVL 50

Expert Comment

by:teylyn
ID: 38829606
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
How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

 

Author Comment

by:sharepoint2013
ID: 38829640
Thanks teylyn

Here you go
screen2.pptx
0
 
LVL 50

Expert Comment

by:teylyn
ID: 38829645
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
 
LVL 50

Expert Comment

by:teylyn
ID: 38829655
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
 

Author Comment

by:sharepoint2013
ID: 38829676
I changed it to http://k1.zone1.company.net/sites/sg/k1_sg/Pro/Forms/DispForm.......

But the title is still empty :(
0
 
LVL 50

Expert Comment

by:teylyn
ID: 38829684
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
 
LVL 50

Expert Comment

by:teylyn
ID: 38829688
And while you're at it, please make sure that the screenshot includes the URL.
0
 

Author Comment

by:sharepoint2013
ID: 38829703
Sorry here it is. I missed it out
screen3.png
0
 
LVL 50

Expert Comment

by:teylyn
ID: 38829709
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
 

Author Comment

by:sharepoint2013
ID: 38829715
In the "edit view" there is no Title column, but only Name
0
 

Author Comment

by:sharepoint2013
ID: 38829717
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
 
LVL 50

Accepted Solution

by:
teylyn earned 500 total points
ID: 38829719
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
 
LVL 50

Expert Comment

by:teylyn
ID: 38829723
The other records are showing because they are using the @FileLeafRef, not the @Title.
0
 

Author Comment

by:sharepoint2013
ID: 38829753
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
 

Author Comment

by:sharepoint2013
ID: 38829791
Ok i changed FileLeafRef.Name to FileLeafRef and it works!
0
 
LVL 50

Expert Comment

by:teylyn
ID: 38829802
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
 

Author Comment

by:sharepoint2013
ID: 38829822
You are amazing :)
0
 

Author Comment

by:sharepoint2013
ID: 38830255
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
 
LVL 50

Expert Comment

by:teylyn
ID: 38830409
What are you trying to do? Why do you append something to the link that opens the display form for the item?
0
 

Author Comment

by:sharepoint2013
ID: 38830480
theres customizations on the page that requires me to add this behind.
0
 

Author Comment

by:sharepoint2013
ID: 38833976
teylyn?
0
 
LVL 50

Expert Comment

by:teylyn
ID: 38834105
I'm not sure I understand what you mean. How about you open a new question about that?
0
 

Author Comment

by:sharepoint2013
ID: 38834135
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

PROBLEM: The other day I was working on adding an ajax request to a webpage that already had a dialog box on the page.  The dialog box was using relative positioning to be positioned next to a form field I had on the page.  Everything was working…
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now