Horizontal bar based on value

baasopchoppyΑσφάλεια

5 Νοε 2013 (πριν από 4 χρόνια και 4 μέρες)

91 εμφανίσεις

Horizontal bar based on value

<xsl:if test="number(@Count) &gt; '0'"><img src="web site images/medium.gif" height="7"
style="width: {format
-
number(@Count, '##')}px;" /></xsl:if>


Filter by Today
-
(n)

<SharePoint:SPDataSource runat="server" SelectCommand="&
lt;View&gt;&lt;Query&gt;&lt;OrderBy&gt;&lt;FieldRef
Name=&quot;Column3&quot;
Ascending=&quot;TRUE&quot;/&gt;&lt;/OrderBy&gt;&lt;Where&gt;&lt;Geq&gt;&lt;FieldRef
Name=&quot;Created&quot;/&gt;&lt;Value Type=&quot;Text&quot;&gt;&lt;Today
OffsetDays=&quot;
-
8&q
uot;
/&gt;&lt;/Value&gt;&lt;/Geq&gt;&lt;/Where&gt;&lt;/Query&gt;&lt;/View&gt;"


Display Count on Group

<xsl:value
-
of select="$fieldvalue" /> &#160;<span style="font
-
weight:normal;">
(<xsl:value
-
of
select="count($nodeset/@Title)" />)
</span>


Redirect after su
bmit on custom form

<input type="button" value="Save" name="btnSave" onclick="javascript:
{ddwrt:GenFireServerEvent
('__commit;__redirect={}')}" />


Display Edit Menu on SP Form

<url>
?
PageView=Shared&ToolPaneView=2


ASP.Net Drop
-
down control (using list val
ues)

http://blogs.msdn.com/b/sharepointdesigner/archive/2007/03/05/asp
-
net
-
controls
-
filter
-
the
-
data
-
view.aspxc



JavaScript Redirect

<
script language="JavaScript" type="text/javascript">


setTimeout("refresh_location()", 1000*60);

// Use setTimeout to set how long the page waits before refresh to new location default: 1000 ms * 60 =
60 seconds


function refresh_loc
ation ()


{


//Change to your redirect location


location = "http://URL.micron.com";


}

</script>

<table align="center" width="550">

<tr>

<td align="center"><b
style="font
-
size:10pt;">The SITE NAME has moved</b><p>

Please wait a moment to be redirected, or go to

<a href="http://URL.micron.com">http://URL.micron.com</a> to visit the site
immediately.</p>

</td>

</tr>

</table>


Enable Attachments on Custom Edit For
m

http://support.microsoft.com/Default.aspx?id=953271


Fix SharePoint Flyouts on Custom Master Pages

From what I can tell so far, IE8 Standards Mode has problems showing SharePoint dynamic

menus (or
flyouts). My current guidance based on my preliminary testing is that all SharePoint master pages should
have this meta tag added:


<meta http
-
equiv="X
-
UA
-
Compatible" content="IE=EmulateIE7" />


Convert String to Number in Calculated field

The f
ield indeed got the value of the Title field, but if I sorted the list by this field, it behaved exactly as if
the field contained a single line of text. So again, 1000 comes before 9. Checked if I indeed set the
calculated field to be a number and well, I

did. The value simply wasn't treated as a number but as text.
Strange...


So I started digging in my development experience and I decided to make a little change to the
expression. I changed the expression to "
=[Title] + 0
".


Display all fields in an XSLT

Transform

<xsl:stylesheet version="1.0"



xmlns:xsl="
http://www.w3.org/1999/XSL/Transform"
>


<xsl:output method="xml" version="1.0" encoding="UTF
-
8" indent="yes"/>


<xsl:template match="/">



<xmp><x
sl:copy
-
of select="*"/></xmp>


</xsl:template>

</xsl:stylesheet>


Disable ‘Actions’ items in Document Library toolbar (using Content Editor)

<script type="text/javascript">

_spBodyOnLoadFunctionNames.push("HideMenuItems()");



function HideMenuItems()

{

//Disable Open In Explorer


i = 0;


while(i < 100)


{


var viewInExplorer = document.getElementById("zz" + i + "_OpenInExplorer");


if (viewInExplorer != null)


{


if (viewInExplorer.parentNod
e != null)


viewInExplorer.parentNode.removeChild(viewInExplorer);


break;


}


i++;


}



//Disable Connect to Outlook


i = 0;


while(i < 100)


{


var connectToOutlook =
document.getElementById("zz" + i + "_OfflineButton");


if (connectToOutlook != null)


{


if (connectToOutlook.parentNode != null)


connectToOutlook.parentNode.removeChild(connectToOutlook);


bre
ak;


}


i++;


}



//Disable Edit In Datasheet


i = 0;


while(i < 100)


{


var editInDatasheet = document.getElementById("zz" + i + "_EditInGridButton");


if (editInDatasheet != null)


{


if (editInDatasheet.parentNode != null)


editInDatasheet.parentNode.removeChild(editInDatasheet);


break;


}


i++;


}


}

</script>

Fix Custom Edit Form Attachments Row


<tr id="
idAttachmentsRow">


<td nowrap="true" valign="top" class="ms
-
formlabel" width="20%">


<SharePoint:FieldLabel ControlMode="Edit" FieldName="Attachments" runat="server"/>


</td>


<td valign="top" class="ms
-
formbody" width="80%">


<SharePoint:FormField runat=
"server" id="AttachmentsField" ControlMode="Edit"
FieldName="Attachments"
__designer:bind="{ddwrt:DataBind('u','AttachmentsField','Value','ValueChanged','ID',ddwrt:EscapeDeli
ms(string(@ID)),'@Attachments')}"/>


<script>



var elm = document.getElementByI
d("idAttachmentsTable");



if (elm == null || elm.rows.length == 0)





document.getElementById("idAttachmentsRow").style.display='none';







</script> </td>






</tr>


Adjust Form Field Width in Custom Form


<script type="text/javascript">

function
removeLocalStyleAttributes() {


var coll = document.body.getElementsByTagName("div");



for(x=0;x < coll.length; x++)


{


if(coll[x].className == "select
-
container") {


var collDivControls = coll[x].getElementsByTagName("DIV");




for(y=0;y < collDivControls.length; y++)


{


collDivControls[y].style.width = null;


collDivControls[y].style.height = null;


}


}


}

}

_spBodyOnLoadFunctionNames.push("removeLocalStyleAttributes");

</script>

-------------------------------------------------


<style>

.select
-
container div{


height:400px; }

</style>

-------------------------------------------------

<td width="400px" valign="top">


<div class="select
-
container">


<SharePoint:FormField runat="server" id="ff13{$Pos}" ControlMode="Edit"
FieldName="OSCompatibility"
__designer:bind="{ddwrt:DataBind('u',concat('ff13',$Pos),'Value','ValueChanged','ID',ddwrt:EscapeDeli
ms(string(@ID)),'@OSCompatibility')}"/>


</div>

</td>



Custom Core Search Results (Includes MTURL link)

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >


<xsl:param name="ResultsBy" />


<xsl:param name="ViewByUrl" />


<xsl:param name="ViewByValue" />


<xsl:param name="IsN
oKeyword" />


<xsl:param name="IsFixedQuery" />


<xsl:param name="ShowActionLinks" />


<xsl:param name="MoreResultsText" />


<xsl:param name="MoreResultsLink" />


<xsl:param name="CollapsingStatusLink" />


<xsl:param name="CollapseDuplicatesText" />


<xsl:param name="AlertMeLink" />


<xsl:param name="AlertMeText" />


<xsl:param name="SrchRSSText" />


<xsl:param name="SrchRSSLink" />


<xsl:param name="ShowMessage" />


<xsl:param name="IsThisListScope" />


<xsl:param name="DisplayDiscoveredDefini
tion" select="True" />


<xsl:param name="NoFixedQuery" />


<xsl:param name="NoKeyword" />


<xsl:param name="NoResults" />


<xsl:param name="NoResults1" />


<xsl:param name="NoResults2" />


<xsl:param name="NoResults3" />


<xsl:param name="NoResults4
" />


<xsl:param name="DefinitionIntro" />



<!
--

When there is keywory to issue the search
--
>


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


<span class="srch
-
description">


<xsl:choose>


<xsl:when test="$IsFixedQuery">


<xsl:value
-
of

select="$NoFixedQuery" />


</xsl:when>


<xsl:otherwise>


<xsl:value
-
of select="$NoKeyword" />


</xsl:otherwise>


</xsl:choose>


</span>


</xsl:template>




<!
--

When empty result set is returned from search
--
>


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


<div class="srch
-
sort">


<xsl:if test="$AlertMeLink and $ShowActionLinks">


<span class="srch
-
alertme" >


<a href ="{$AlertMeLink}" id="CSR_AM1" title="{$AlertMeText}">


<img style="verti
cal
-
align: middle;" src="/_layouts/images/bell.gif" alt="" border="0"/>


<xsl:text disable
-
output
-
escaping="yes">&amp;nbsp;</xsl:text>


<xsl:value
-
of select="$AlertMeText" />


</a>


</span>


</xsl:if>



<xsl:
if test="string
-
length($SrchRSSLink) &gt; 0 and $ShowActionLinks">


<xsl:if test="$AlertMeLink">


|


</xsl:if>


<a type="application/rss+xml" href ="{$SrchRSSLink}" title="{$SrchRSSText}" id="SRCHRSSL">


<img style="v
ertical
-
align: middle;" border="0" src="/_layouts/images/rss.gif" alt=""/>


<xsl:text disable
-
output
-
escaping="yes">&amp;nbsp;</xsl:text>


<xsl:value
-
of select="$SrchRSSText"/>


</a>


</xsl:if>


</div>


<br/>


<br/>



<span class="srch
-
description" id="CSR_NO_RESULTS">


<xsl:value
-
of select="$NoResults" />



<ol>


<li>


<xsl:value
-
of select="$NoResults1" />


</li>


<li>


<xsl:value
-
of select="$NoResults2" />


<
/li>


<li>


<xsl:value
-
of select="$NoResults3" />


</li>


<li>


<xsl:value
-
of select="$NoResults4" />


</li>


</ol>


</span>


</xsl:template>




<
!
--

Main body template. Sets the Results view (Relevance or date) options
--
>


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


<div class="srch
-
results">


<xsl:if test="$ShowActionLinks">


<div class="srch
-
sort">


<xsl:value
-
of select="$ResultsB
y" />


<xsl:if test="$ViewByUrl">


|


<a href ="{$ViewByUrl}" id="CSR_RV" title="{$ViewByValue}">


<xsl:value
-
of select="$ViewByValue" />


</a>


</xsl:if>


<xsl:if test="$AlertMeLink"
>


|


<span class="srch
-
alertme" >


<a href ="{$AlertMeLink}" id="CSR_AM2" title="{$AlertMeText}">


<img style="vertical
-
align: middle;" src="/_layouts/images/bell.gif" alt="" border="0"/>


<
xsl:text disable
-
output
-
escaping="yes">&amp;nbsp;</xsl:text>


<xsl:value
-
of select="$AlertMeText" />


</a>


</span>


</xsl:if>


<xsl:if test="string
-
length($SrchRSSLink) &gt; 0">


|



<a type="application/rss+xml" href ="{$SrchRSSLink}" title="{$SrchRSSText}" id="SRCHRSSL">


<img style="vertical
-
align: middle;" border="0" src="/_layouts/images/rss.gif" alt=""/>


<xsl:text disable
-
output
-
escaping="yes">&am
p;nbsp;</xsl:text>


<xsl:value
-
of select="$SrchRSSText"/>


</a>


</xsl:if>


</div>


<br />


<br />


</xsl:if>


<xsl:apply
-
templates />



</div>



<xsl:call
-
template name="
DisplayMoreResultsAnchor" />


</xsl:template>



<!
--

This template is called for each result
--
>


<xsl:template match="Result">


<xsl:variable name="id" select="id"/>


<xsl:variable name="url" select="url"/>


<xsl:variable name="mturl" select="
mturl"/>




<xsl:if test="$mturl!=''">



<span class="srch
-
Icon">


<img align="absmiddle" src="{imageurl}" border="0" alt="{imageurl/@imageurldescription}" />


</span>


<xsl:choose>


<xsl:when test="$IsThisListScope = 'True'

and contentclass[. = 'STS_ListItem_PictureLibrary'] and
picturethumbnailurl[. != '']">


<div style="padding
-
top: 2px; padding
-
bottom: 2px;">


<img src="{picturethumbnailurl}" alt="" />


</div>


</xsl:when>


</
xsl:choose>





<span class="srch
-
Description">



<!
--
URL to Item
--
>


<xsl:call
-
template name="DisplayCustomURL">


<xsl:with
-
param name="str" select="mturl" />


</xsl:call
-
template>



<!
--
Summary Text
--
>


<d
iv style="margin
-
left:20px;">


<xsl:if test="description[. != '']">


<xsl:value
-
of select="description"/>


</xsl:if>


<!
--
This span is required to force the closing div tag. no clue why this is
--
>


<span></span>


</div>


</span >


<hr style="color:#ebebeb; height:1px; margin
-
bottom:5px;" />


</xsl:if>


</xsl:template>




<xsl:template name="HitHighlighting">


<xsl:param name="hh" />


<xsl:apply
-
templates select="$hh"/>


</xsl:template
>



<xsl:template match="ddd">


&#8230;


</xsl:template>


<xsl:template match="c0">


<b>


<xsl:value
-
of select="."/>


</b>


</xsl:template>


<xsl:template match="c1">


<b>


<xsl:value
-
of select="."/>


</b>


</xsl:template>


<xsl:template match="c2">


<b>


<xsl:value
-
of select="."/>


</b>


</xsl:template>


<xsl:template match="c3">


<b>


<xsl:value
-
of select="."/>


</b>


</xsl:template>


<xsl:template match="c4">


<b>


<xsl:value
-
of
select="."/>


</b>


</xsl:template>


<xsl:template match="c5">


<b>


<xsl:value
-
of select="."/>


</b>


</xsl:template>


<xsl:template match="c6">


<b>


<xsl:value
-
of select="."/>


</b>


</xsl:template>


<xsl:template match="c
7">


<b>


<xsl:value
-
of select="."/>


</b>


</xsl:template>


<xsl:template match="c8">


<b>


<xsl:value
-
of select="."/>


</b>


</xsl:template>


<xsl:template match="c9">


<b>


<xsl:value
-
of select="."/>


</b>


</
xsl:template>




<!
--

The size attribute for each result is prepared here
--
>


<xsl:template name="DisplaySize">


<xsl:param name="size" />


<xsl:if test='string
-
length($size) &gt; 0'>


<xsl:if test="number($size) &gt; 0">


-


<x
sl:choose>


<xsl:when test="round($size div 1024) &lt; 1">


<xsl:value
-
of select="$size" /> Bytes


</xsl:when>


<xsl:when test="round($size div (1024 *1024)) &lt; 1">


<xsl:value
-
of select="round($size div 1
024)" />KB


</xsl:when>


<xsl:otherwise>


<xsl:value
-
of select="round($size div (1024 * 1024))"/>MB


</xsl:otherwise>


</xsl:choose>


</xsl:if>


</xsl:if>


</xsl:template>





<!
--

A generic template t
o display string with non 0 string length (used for author and lastmodified time
--
>


<xsl:template name="DisplayString">


<xsl:param name="str" />


<xsl:if test='string
-
length($str) &gt; 0'>


-


<xsl:value
-
of select="$str" />


</xsl:if
>


</xsl:template>



<xsl:template name="DisplayCustomURL">


<xsl:param name="str" />


<xsl:if test="$str!=''">


<xsl:variable name="ahref" select="substring
-
before($str, ';')" />


<xsl:variable name="title" select="substring
-
after($str,
';')" />


<a href="{$ahref}" title="{$ahref}" style="font
-
size:8pt; font
-
weight:bold;" target="_blank">


<xsl:choose>


<xsl:when test="$title=''">


<xsl:value
-
of select="$ahref" />


</xsl:when>


<xsl:otherw
ise>


<xsl:value
-
of select="$title" />


</xsl:otherwise>


</xsl:choose>


</a>


<br/>


</xsl:if>


</xsl:template>



<!
--

document collapsing link setup
--
>


<xsl:template name="DisplayCollapsingStatusLink">


<
xsl:param name="status"/>


<xsl:param name="urlEncoded"/>


<xsl:param name="id"/>


<xsl:if test="$CollapsingStatusLink">


<xsl:choose>


<xsl:when test="$status=1">


<br/>


<xsl:variable name="CollapsingStatusHref" sel
ect="concat(substring
-
before($CollapsingStatusLink,
'$$COLLAPSE_PARAM$$'), 'duplicates:&quot;', $urlEncoded, '&quot;', substring
-
after($CollapsingStatusLink, '$$COLLAPSE_PARAM$$'))"/>


<span class="srch
-
dup">


[<a href="{$CollapsingStat
usHref}" id="$id" title="{$CollapseDuplicatesText}">


<xsl:value
-
of select="$CollapseDuplicatesText"/>


</a>]


</span>


</xsl:when>


</xsl:choose>


</xsl:if>


</xsl:template>


<!
--

The "view more results" f
or fixed query
--
>


<xsl:template name="DisplayMoreResultsAnchor">


<xsl:if test="$MoreResultsLink">


<a href="{$MoreResultsLink}" id="CSR_MRL">


<xsl:value
-
of select="$MoreResultsText"/>


</a>


</xsl:if>


</xsl:template>



<xsl:t
emplate match="All_Results/DiscoveredDefinitions">


<xsl:variable name="FoundIn" select="DDFoundIn" />


<xsl:variable name="DDSearchTerm" select="DDSearchTerm" />


<xsl:if test="$DisplayDiscoveredDefinition = 'True' and string
-
length($DDSearchTerm
) &gt; 0">


<script language="javascript">


function ToggleDefinitionSelection()


{


var selection = document.getElementById("definitionSelection");


if (selection.style.display == "none")


{


selection.style.
display = "inline";


}


else


{


selection.style.display = "none";


}


}


</script>


<div>


<a href="#" onclick="ToggleDefinitionSelection(); return false;">


<xsl:value
-
of select="$Defini
tionIntro" />


<b>


<xsl:value
-
of select="$DDSearchTerm"/>


</b>


</a>


<div id="definitionSelection" class="srch
-
Description" style="display:none;">


<xsl:for
-
each select="DDefinitions/DDefinition">



<br/>


<xsl:variable name="DDUrl" select="DDUrl" />


<xsl:value
-
of select="DDStart"/>


<b>


<xsl:value
-
of select="DDBold"/>


</b>


<xsl:value
-
of select="DDEnd"/>


<br/>


<xsl:value
-
of select="$FoundIn"/>


<a href="{$DDUrl}">


<xsl:value
-
of select="DDTitle"/>


</a>


</xsl:for
-
each>


</div>


</div>


</xsl:if>


</xsl:template>



<!
--

XSL transformation s
tarts here
--
>


<xsl:template match="/">


<xsl:if test="$AlertMeLink">


<input type="hidden" name="P_Query" />


<input type="hidden" name="P_LastNotificationTime" />


</xsl:if>


<xsl:choose>


<xsl:when test="$IsNoKeyword = 'True'"
>


<xsl:call
-
template name="dvt_1.noKeyword" />


</xsl:when>


<xsl:when test="$ShowMessage = 'True'">


<xsl:call
-
template name="dvt_1.empty" />


</xsl:when>


<xsl:otherwise>


<xsl:call
-
template name="dvt_1.body"/>


</xsl:otherwise>


</xsl:choose>


</xsl:template>



<!
--

End of Stylesheet
--
>

</xsl:stylesheet>


Rotate Gantt/Hide details

<style type="text/css">

.ms
-
ganttInnerTable IMG {width:2px;}

.ms
-
ganttDetailTimeUnitRow * {display:none;}

.ms
-
ganttInnerTa
ble .ms
-
ganttMajorTimeUnitHeaderCell {writing
-
mode: tb
-
rl;filter: flipv fliph;border:0;}

.ms
-
summarystandardbody {display: none;}

</style>