- Use Office 2010 client to the output from the web server.
- In SP2010, create a new document library.
- Add a MM type column.
- Open MSFT Word 2010 and save the document lib in the SP lib.
- Goto %LOCALAPPDATA%\Microsoft\Office\TermSets and look for GUID.XML file that was recently added. (Note: Ensure you hidden files are viewable)
- Select this file and copy it to you folder.
- Use XSLT to transfer this content into the Format required to Import CSV.
Here is a document from MSFT, which provides details on the format
http://technet.microsoft.com/en-us/library/ee424396%28v=office.14%29.aspx
Tuesday, April 16, 2013
Export/Import TermStore without any code (Exception XSLT) especially for O365
Wednesday, April 3, 2013
Welcome, First Name Last Name (JQuery Library for SharePoint Web Services)
When a user signs into SP Portal, on the top right hand corner you see name in Format of Last Name, First Name. You could change that by simply using Jquery + SPService (JQuery Library for SharePoint Web Services)
SPService is absolutely phenomenal. It can simply do so much with so little code.
Here is what you need to do to accomplish the desired results.
- Create a new JS file and link it from your master page.
- Add a reference to JQuery.SPServices-0.N.N.js to your master page and before your custom .JS File.
- In the .js file add the following code:
$(document).ready(function() {
$(".ms-welcomeMenu a.ms-menu-a span").text("Welcome, " + userName);
window.userName = "";
var thisUserFirstName = $().SPServices.SPGetCurrentUser({
fieldName: "FirstName",
debug: false
});
var thisUserLastName = $().SPServices.SPGetCurrentUser({
fieldName: "LastName",
debug: false
});
window.userName = thisUserFirstName + " " + thisUserLastName;
}
Once this code has been put in place, when a user sign in to SP, they will see Welcome, First Name + " " + LastName on the right hand top corner.
Tuesday, April 2, 2013
Render (Published Mode/Edit Mode) OOTB RSS Control
Worked on an OOTB Rss Control web part in O365. It suddenly stopped working on the Home Page. It still works fine on a couple of other pages, but stopped working on the Home Page. The stopped working means that the "loading graphic" stays on Home Page and the RSS Feed never gets rendered. The moment you go into the edit mode, the RSS feed is rendered correctly. This is one of the strangest issues I have seen either this is something related to Office 365?
Here is what I did
Solution:
Used XMLViewer WebPart in place of RSS Control web part and then wrote XSLT used for rendering the content. The 2 things to note here are that
Here is what I did
- Master Page is same across the site. Same set of JS/CSS files are loaded on all pages.
- PageLayout is different. Tried all combinations with using same page layout/rebuilding page layout/ adding components 1 by 1, but still would not work.
- There are not many configuration settings that you can modify for OOTB RSS Feed.
Solution:
Used XMLViewer WebPart in place of RSS Control web part and then wrote XSLT used for rendering the content. The 2 things to note here are that
- Produce the same look & feel
- Limit the Results to a certain number.
Tuesday, March 26, 2013
Change Ratings.png file SPOnline/Office365
There are at least 2 ways available for achieving this:
- You could do this in JQuery
- You could make a change in SP Designer by making change in the SiteOptions. In the SiteOptions, there is a property Ratings [ratings_imagestripurl], you can update this value. The only catch here is the APP pool has to be restarted.
Change Ratings for Blue to Golden - SP Online Office365
How do you change the ratings from blue to control on the RatingsControl that is rendered.
In SP Online, you have lot of limitations and your best friend is JQuery. There are several ways in which this can be accomplished. A simple way is to swap the class that is used when the ratings control is rendered on the page. Here is how the command will look.
$(".ms-rating_1").addClass("ms-rating_1_new").removeClass("ms-rating_1");
The only issue with this is that there is no matching class when the average rating is 1.5, 2.5...and so forth. In that scenario, you would have to create a new mirror opposite of the rating image and load it to your images folder.
This is an example of that type of code. In this, we would add a class and remove the existing class and then replace the image.
//$(".ms-rating_4_5").addClass("ms-rating_4_5_new").removeClass("ms-rating_4_5").attr("src", "/sites/ynn/siteAssets/images/Ratings/ratingsEmptyCustom.png")
Alternatively, if you can live without averages rounded to .5 then you can simply do this:
$(".ms-rating_1_5").addClass("ms-rating_2_new").removeClass("ms-rating_1_5");
In SP Online, you have lot of limitations and your best friend is JQuery. There are several ways in which this can be accomplished. A simple way is to swap the class that is used when the ratings control is rendered on the page. Here is how the command will look.
$(".ms-rating_1").addClass("ms-rating_1_new").removeClass("ms-rating_1");
The only issue with this is that there is no matching class when the average rating is 1.5, 2.5...and so forth. In that scenario, you would have to create a new mirror opposite of the rating image and load it to your images folder.
This is an example of that type of code. In this, we would add a class and remove the existing class and then replace the image.
//$(".ms-rating_4_5").addClass("ms-rating_4_5_new").removeClass("ms-rating_4_5").attr("src", "/sites/ynn/siteAssets/images/Ratings/ratingsEmptyCustom.png")
Alternatively, if you can live without averages rounded to .5 then you can simply do this:
$(".ms-rating_1_5").addClass("ms-rating_2_new").removeClass("ms-rating_1_5");
Wednesday, March 6, 2013
CQWP - Display content from 3rd(N) Position Onwards
Here are the steps:
<xsl:template name="Display2NDRowOnwards" match="Row[@Style='ImageTopCentered']" mode="itemstyle">
<xsl:variable name="SafeLinkUrl">
<xsl:call-template name="OuterTemplate.GetSafeLink">
<xsl:with-param name="UrlColumnName" select="'LinkUrl'"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="SafeImageUrl">
<xsl:call-template name="OuterTemplate.GetSafeStaticUrl">
<xsl:with-param name="UrlColumnName" select="'ImageUrl'"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="DisplayTitle">
<xsl:call-template name="OuterTemplate.GetTitle">
<xsl:with-param name="Title" select="@Title"/>
<xsl:with-param name="UrlColumnName" select="'LinkUrl'"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="ItemNumber">
<xsl:number format="1"></xsl:number>
</xsl:variable>
<div class="item centered4">
<xsl:if test="string-length($SafeImageUrl) != 0">
<div class="image-area-top">
<a href="{$SafeLinkUrl}" >
<xsl:if test="$ItemsHaveStreams = 'True'">
<xsl:attribute name="onclick">
<xsl:value-of select="@OnClickForWebRendering"/>
</xsl:attribute>
</xsl:if>
<xsl:if test="$ItemsHaveStreams != 'True' and @OpenInNewWindow = 'True'">
<xsl:attribute name="onclick">
<xsl:value-of disable-output-escaping="yes" select="$OnClickTargetAttribute"/>
</xsl:attribute>
</xsl:if>
<img class="image" src="{$SafeImageUrl}" title="{@ImageUrlAltText}">
<xsl:if test="$ImageWidth != ''">
<xsl:attribute name="width">
<xsl:value-of select="$ImageWidth" />
</xsl:attribute>
</xsl:if>
<xsl:if test="$ImageHeight != ''">
<xsl:attribute name="height">
<xsl:value-of select="$ImageHeight" />
</xsl:attribute>
</xsl:if>
</img>
</a>
</div>
</xsl:if>
<div class="link-item">
<xsl:call-template name="OuterTemplate.CallPresenceStatusIconTemplate"/>
<a href="{$SafeLinkUrl}" title="{@LinkToolTip}">
<xsl:if test="$ItemsHaveStreams = 'True'">
<xsl:attribute name="onclick">
<xsl:value-of select="@OnClickForWebRendering"/>
</xsl:attribute>
</xsl:if>
<xsl:if test="$ItemsHaveStreams != 'True' and @OpenInNewWindow = 'True'">
<xsl:attribute name="onclick">
<xsl:value-of disable-output-escaping="yes" select="$OnClickTargetAttribute"/>
</xsl:attribute>
</xsl:if>
<xsl:if test="$ItemNumber > 2">
<xsl:value-of select="$ItemNumber" />
<xsl:value-of select="$DisplayTitle"/>
</xsl:if>
</a>
<div class="description">
<xsl:value-of select="@Description" />
</div>
</div>
</div>
</xsl:template>
- Open ItemStyle.XSLT file
- Simply create your own template by copying an existing template.
- Insert the bold variable.
- Add an "If" condition where the content is rendered.
<xsl:template name="Display2NDRowOnwards" match="Row[@Style='ImageTopCentered']" mode="itemstyle">
<xsl:variable name="SafeLinkUrl">
<xsl:call-template name="OuterTemplate.GetSafeLink">
<xsl:with-param name="UrlColumnName" select="'LinkUrl'"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="SafeImageUrl">
<xsl:call-template name="OuterTemplate.GetSafeStaticUrl">
<xsl:with-param name="UrlColumnName" select="'ImageUrl'"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="DisplayTitle">
<xsl:call-template name="OuterTemplate.GetTitle">
<xsl:with-param name="Title" select="@Title"/>
<xsl:with-param name="UrlColumnName" select="'LinkUrl'"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="ItemNumber">
<xsl:number format="1"></xsl:number>
</xsl:variable>
<div class="item centered4">
<xsl:if test="string-length($SafeImageUrl) != 0">
<div class="image-area-top">
<a href="{$SafeLinkUrl}" >
<xsl:if test="$ItemsHaveStreams = 'True'">
<xsl:attribute name="onclick">
<xsl:value-of select="@OnClickForWebRendering"/>
</xsl:attribute>
</xsl:if>
<xsl:if test="$ItemsHaveStreams != 'True' and @OpenInNewWindow = 'True'">
<xsl:attribute name="onclick">
<xsl:value-of disable-output-escaping="yes" select="$OnClickTargetAttribute"/>
</xsl:attribute>
</xsl:if>
<img class="image" src="{$SafeImageUrl}" title="{@ImageUrlAltText}">
<xsl:if test="$ImageWidth != ''">
<xsl:attribute name="width">
<xsl:value-of select="$ImageWidth" />
</xsl:attribute>
</xsl:if>
<xsl:if test="$ImageHeight != ''">
<xsl:attribute name="height">
<xsl:value-of select="$ImageHeight" />
</xsl:attribute>
</xsl:if>
</img>
</a>
</div>
</xsl:if>
<div class="link-item">
<xsl:call-template name="OuterTemplate.CallPresenceStatusIconTemplate"/>
<a href="{$SafeLinkUrl}" title="{@LinkToolTip}">
<xsl:if test="$ItemsHaveStreams = 'True'">
<xsl:attribute name="onclick">
<xsl:value-of select="@OnClickForWebRendering"/>
</xsl:attribute>
</xsl:if>
<xsl:if test="$ItemsHaveStreams != 'True' and @OpenInNewWindow = 'True'">
<xsl:attribute name="onclick">
<xsl:value-of disable-output-escaping="yes" select="$OnClickTargetAttribute"/>
</xsl:attribute>
</xsl:if>
<xsl:if test="$ItemNumber > 2">
<xsl:value-of select="$ItemNumber" />
<xsl:value-of select="$DisplayTitle"/>
</xsl:if>
</a>
<div class="description">
<xsl:value-of select="@Description" />
</div>
</div>
</div>
</xsl:template>
Tuesday, November 20, 2012
SharePoint Discussion Board - Hide (View/Edit) Link
How do you conditionally hide (View Item) Link on the threaded view?
It is not the best way, in which the discussion board has the link displayed on the UI. Technically, there is a setting that you can set where a user who creates the post is only allowed to edit. However, that check only occurs when you click on Edit Item and SP will either display the edit page or will give access denied.
This is the JQuery I wrote to hide the link for each post comparing signed in user to the user who posted. If the 2 names are different, I hide the link and if they are same I replace the display value with "View/Edit".
$("a[href*='_layouts/userdisp.aspx']").each(function (index) {
if ($(this).text().length > 0) {
if ($(this).text().toLowerCase() != jQuery.trim(thisUserAccount.toLowerCase())) {
// Work $(this).parent().parent().parent().parent().parent()[0].firstChild.nextSibling.innerText = '';
$(this).parent().parent().parent().parent().parent()[0].firstChild.nextSibling.firstChild.firstChild.innerHTML = ''
}
else {
$(this).parent().parent().parent().parent().parent()[0].firstChild.nextSibling.firstChild.firstChild.innerHTML = '<NOBR>Edit/Delete</NOBR>';
}
}
});
It is not the best way, in which the discussion board has the link displayed on the UI. Technically, there is a setting that you can set where a user who creates the post is only allowed to edit. However, that check only occurs when you click on Edit Item and SP will either display the edit page or will give access denied.
This is the JQuery I wrote to hide the link for each post comparing signed in user to the user who posted. If the 2 names are different, I hide the link and if they are same I replace the display value with "View/Edit".
$("a[href*='_layouts/userdisp.aspx']").each(function (index) {
if ($(this).text().length > 0) {
if ($(this).text().toLowerCase() != jQuery.trim(thisUserAccount.toLowerCase())) {
// Work $(this).parent().parent().parent().parent().parent()[0].firstChild.nextSibling.innerText = '';
$(this).parent().parent().parent().parent().parent()[0].firstChild.nextSibling.firstChild.firstChild.innerHTML = ''
}
else {
$(this).parent().parent().parent().parent().parent()[0].firstChild.nextSibling.firstChild.firstChild.innerHTML = '<NOBR>Edit/Delete</NOBR>';
}
}
});
Subscribe to:
Posts (Atom)
