Thursday, December 17, 2015

How to Add a Google Map to your SharePoint Page

Do you want to add a Google map to your SharePoint page, so clients and colleagues can find your business or organization? It is easy to do.

1) Go to http://maps.google.com

2) Enter your desired location in the Search box and click the Search button.

3) Click on the "Share" link.

4) On the pop-up window, click on "Embed map".

5) Select a map size from the drop-down (optional).

6) Copy the auto-generated code from the pop-up textbox.

7) Add a Content Editor web part to your SharePoint page, and edit the web part.

8) Paste the code copied from the pop-up textbox into the Content Editor web part.

That's it!


Cheers!
Leo

How To Add a Weather Report to your SharePoint page

It's easy to add a live weather report like the one below to your SharePoint site.




Here's how to add the weather report:
1) Go to http://www.wunderground.com/stickers/ and follow the steps to create your "weather sticker".
2) The code to create the weather sticker will be emailed to you.
3) Go to the SharePoint page you want add your weather report to.
4) Click on "Site Actions -> Edit Page".
5) Add a Content Editor web part to your page.
6) Edit the web part, and click on "Click here to add new content".
7) In the ribbin under "Editing Tools", click on the "Format Text" tab.
8) In the markup section of the ribbon, click on "HTML -> Edit HTML Source".
9) Paste the code from Wunderground into the HTML Source window, and click "OK".
10) On the ribbon, click on "Save & Close".


Enjoy!
Leo

How to Create a Custom Greeting in SharePoint

Here a simple greeting you can create with the out-of-the-box Content Editor web part and some JavaScript. The script obtains the user's name from the SharePoint display name, and determines what time of the day it is to display the correct greeting as the following example.

Good morning, Leo!


Here's how to create the greeting. Add a Content Editor web part to your SharePoint page and add the following code to it:

<script type="text/javascript">
ExecuteOrDelayUntilScriptLoaded(init,'sp.js');
var currentUser;
var title;
var trimmed;
var titleAry;
var currentDate;
var currentHours;


function init(){
    this.clientContext = new SP.ClientContext.get_current();
    this.oWeb = clientContext.get_web();
    currentUser = this.oWeb.get_currentUser();
    this.clientContext.load(currentUser);
    this.clientContext.executeQueryAsync(Function.createDelegate(this,this.onQuerySucceeded), Function.createDelegate(this,this.onQueryFailed));
}


function onQuerySucceeded() {
    currentDate = new Date();
    currentHours = currentDate.getHours();
    if (currentHours >= 5 && currentHours < 12) { greeting = "Good morning"; }
    else if (currentHours >= 12 && currentHours <= 17) { greeting = "Good afternoon"; }
    else if (currentHours < 5 || currentHours > 17) { greeting = "Good evening"; }


    title = currentUser.get_title();
    trimmed = title.replace(/^\s+|\s+$/g, '');
    titleAry = trimmed.split(" ");
    document.getElementById('userTitle').innerHTML = greeting + ", " + titleAry[2] + "!";
}


function onQueryFailed(sender, args) {
    alert('Request failed. \nError: ' + args.get_message() + '\nStackTrace: ' + args.get_stackTrace());
}


</script><div style="font-size: 14pt; color: green"><b><span id="userTitle"></span></b></div>


NOTE: The user's name is obtained by parsing the display name. In this code example, the display name format is "LastName Title/Rank FirstName MI". So, the third token ([2]) is used to obtain the user's first name. You may need to modify the code depending on your organization's display name format.

Enjoy!
Leo

Wednesday, December 9, 2015

How to Add a Site Banner in SharePoint 2013

SharePoint 2013 limits you to a 64x64 site icon for the header.

If you prefer to use a large site banner, follow these steps.


1) Open your site in SharePoint Designer 2013.

2) In the Navigation Pane, click on "Master Pages".

3) Right-click on your default master page. ("seattle.master" is the default master page in SharePoint 2013)

4) Comment out the line below as follows:

   <!-- <SharePointDelegateControl id="ID_SuiteBarBrandingDelegate" ControlId="SuiteBarBrandingDelegate" runat="server"/> -->

   This will remove the default "SharePoint" title from the banner on the top of the page.

5) Right below the commented line, add your image like the following example:

   <img alt="Bantay Consulting" height="64" width="256" src="/Images/leo_banner.jpg">

Note: You can also use these same steps to add image buttons by wrapping your image within <a></a> tags.

   Ex: <a href="/HelpDesk/default.aspx"><img alt="Submit a Help Desk Ticket" src="ticket.jpg"></a>

Cheers!
Leo

Tips For Speeding Up Your SharePoint Site

Here are a few things to try if you SharePoint pages are loading slowly.

1) Configure your Site Collection Output Cache.
   a) Click on "Site Actions -> Site Settings".
   b) In the Site Collection Administration section, click on "Site collection output cache".
   c) Click on the "Enable output cache" checkbox.
   d) For "Authentication Cache Profile", choose "Intranet (Collaboration Site)".
   e) For "Output Cache Policy:, check both "Publishing sites" and "Page layouts".
   f) Uncheck the "Enable debug cache" checkbox.
   g) Click "OK".

2) Resize large images to be smaller.
   a) Using a program like "MS Paint", reduce the image size and replace the site image with the smaller one.
   b) Changing the image type to a .GIF or .JPG can also reduce the size since it is more compressed.

3) Resize large documents.
   a) PDFs can be reduced by opening the file in Adobe Acrobat, and clicking on "File -> Save As -> Reduced size PDF".

4) Check if there are any hidden, unused web parts on the page and remove them.

Cheers!
Leo

Tuesday, December 8, 2015

How to Add Scrolling Text to a SharePoint Page

It is very simple to add scrolling text to a SharePoint page without having to develop a custom web part solution. All you need is the out-of-the-box Content Editor web part and a snippet of JavaScript code.


Here is how to add scrolling text to your SharePoint page:
1) On the page you want to add scrolling text to, click on Site Actions -> Edit Page
2) Insert a Content Editor web part to your page.
3) Edit the web part.
4) Click on "Click here to add new content".
5) On the ribbon under "Editing Tools", click on "Format Text".
6) In the "Markup" section of the ribbon, click on "HTML", and select "Edit HTML Source".
7) In the HTML Source window, add the following JavaScript code:

<font color="#ff0000" face="Verdana" size="3"><p align="center"><marquee width="800" height="20" scrolldelay="120" style="height: 20px; width: 800px"><div align="left">NOTICE: You text goes here.</div></marquee></p></font>

8) Click "OK" to close the HTML Source window.
9) Click on "Save & Close" button on the ribbon to save and apply your changes.

You can modify the following variables:
color - text color
face - font style
scrolldelay - scroll speed
height - scrolling text area height
width - scrolling text area width

Cheers!
Leo