Tuesday, 22 August 2017

Summary Links accordion Webpart in Sharepoint 2013




1. First I added the Summary link web part in my page and added grouping of those links. See in fig
2.  Now enable the all group as an Accordion I simply added Script Editor Web part to this page. See in fig
3. Now I am going to making this web part into a fully functional accordion for this I added a simple JQuery script the performs hide all hyperlinks in this groups and when a user clicks a group header, hide all sections that is not the current header and expand current selected link selection. So add the following code

<style type="text/css">
.groupheader{
    background-color: #0072C6;
    color: white;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    font-size: 140%;
    padding: 0.5em;
    padding-left: 0.75em;
    margin-right: 0.5em;
    margin-bottom: 1px;
}



.groupmarker:hover .groupheader{

    cursor: pointer;
    background-color: #0597FF;
}
.dfwp-list{
background-color: #181009;
margin-bottom: 0.5em;
margin-right: 0.75em;
margin-left: 0.75em;
margin-bottom: 1px;
}
.dfwp-list .item:hover{
    background-color: #db9356;
}
.dfwp-list .link-item a{
    margin-left: 2em;
    color: white;
}
</style>
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<script type="text/javascript" src="http://gsgd.co.uk/sandbox/jquery/easing/jquery.easing.1.3.js"></script>
<script>
$(document).ready(function(){

            // Detect if user view or edit the page
            if($("#MSOSPWebPartManager_DisplayModeName").val() == "Browse"){
                        // Register accordion
                        accordion();
            }
})
var accordion = function(){

            /* Do fancy easing */
            $.easing.def = "easeOutBounce";

            /* Slide up all link items and hide them */
            /*$(".dfwp-list").slideUp("fast");*/
            $(".dfwp-list").not(":first").slideUp("fast")
            /* Binding a click event handler to the links: */
            $('.groupheader').click(function(e){

                        /* Finding the drop down list that corresponds to the current section: */
                        var dropDown = $(this).next(".dfwp-list");

                        /* Closing all other drop down sections, except the current one */
                        $('.dfwp-list').not(dropDown).slideUp('slow');
                        dropDown.slideToggle('fast');

            })
}
</script> 

4. Whole code added here. See in fig

5. Now you able to see your web part work as an Accordion. See in figs and compare with first fig you able to see the changes.


Saturday, 10 January 2015

Custom Site Action Settings Menu in SharePoint 2013

To Create a Custom Action for “Settings” menu you would need the following 
·         Visual Studio 2012
·         Visual Studio 2012 tools for SharePoint
Once you have Installed these lets look at the Steps.

Steps Involved:

I. Open Visual Studio 2012.

ii. Go to File => New =>Project.

iii. Select Empty SharePoint project template from the installed template 

     SharePoint => 2012.

iv. Enter the Name and click OK.

v. Check the option "Deploy as a Sandbox solution".

vi. Click Ok.

vii. Right click on the solution and select "Add a new item".

viii. Select Empty Element template, enter the Name and click Ok.

ix. In the Elements.xml replace the code with the following.


<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">

  <CustomAction
    Id="CreateSite"
    GroupId="SiteActions"
    Location="Microsoft.SharePoint.StandardMenu"
    Sequence="2000"
    Title="Create New Site"
    Description="Create Site Link" >
    <UrlAction Url="~site/_layouts/15/newsbweb.aspx"/>
</CustomAction>

</Elements>

x. Go to the SharePoint site where you have deployed your solution.

xi. Go to Site Actions, you will see last option for 
Create New Site. 






Thursday, 11 December 2014

An exception occurred when trying to establish endpoint for context: Could not load file or assembly


Problem: When I Open Site in SharePoint I’m getting this error.


An exception occurred when trying to establish endpoint for context: Could not load file or assembly 'Microsoft.IdentityModel.Extensions, Version=2.0.0.0, Culture=neutral, PublicKeyToken=69c3241e6f0468ca' or one of its dependencies. Provider type not defined. (Exception from HRESULT: 0x80090017).

Solution

Go To Administrative Tools -> Local Security Policy->User Right Assignement ->
Impersonate a Client after authentication-> Select and click  Add application pool Account
Logon batch job->Add application pool account and
Reset IIS-> Open Cmd prompt as Admin type  iisreset



Monday, 8 December 2014

Connecting Power shell to Office365

The most powerful way to manage Office 365 is by using PowerShell, a command line interface that connects to Office 365 via the Internet.

Start the Powershell command line

Now that you have the tools installed, you can go ahead and open Powershell. The easiest way to do this is to press the start button and simply typepowershell
You will now see a Powershell window, and the fun can begin!

Using Powershell

Now that you have a Powershell Window open, you can connect to Microsoft Office 365.
Firstly, you need to create a connection to Office 365. You can do this by typing (or copying/pasting) the following into Powershell.

$session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri "https://ps.outlook.com/powershell/" -Credential $cred -Authentication Basic -AllowRedirection

Once this is in the Powershell window, press Enter to execute the command.


Now you simply type in the username and password for an Administrator account in your Office 365 and click OK.
You will probably see some warnings.  Don’t worry, they are normal.
You are now authenticated into Office 365. The last step is to connect up to Office 365 by using the following Powershell command:
Import-PSSession $session


Congratulations! You’re connected!
Now you’ve gone to all the trouble of connecting to Powershell, let’s do something to prove that it works. Type the following into the Powershell window and press Enter:
get-mailbox
You should now see a list of all the users in your Office 365 account that have mailboxes!

Wednesday, 23 July 2014

ListTemplated Id's

  • 100   Generic list
  • 101   Document library
  • 102   Survey
  • 103   Links list
  • 104   Announcements list
  • 105   Contacts list
  • 106   Events list
  • 107   Tasks list
  • 108   Discussion board
  • 109   Picture library
  • 110   Data sources
  • 111   Site template gallery
  • 112   User Information list
  • 113   Web Part gallery
  • 114   List template gallery
  • 115   XML Form library
  • 116   Master pages gallery
  • 117   No-Code Workflows
  • 118   Custom Workflow Process
  • 119   Wiki Page library
  • 120   Custom grid for a list
  • 130   Data Connection library
  • 140   Workflow History
  • 150   Gantt Tasks list
  • 200   Meeting Series list
  • 201   Meeting Agenda list
  • 202   Meeting Attendees list
  • 204   Meeting Decisions list
  • 207   Meeting Objectives list
  • 210   Meeting text box
  • 211   Meeting Things To Bring list
  • 212   Meeting Workspace Pages list
  • 301   Blog Posts list
  • 302   Blog Comments list
  • 303   Blog Categories list
  • 1100   Issue tracking
  • 1200   Administrator tasks list

Monday, 14 July 2014

Auto Refreshing SharePoint Page

To refresh a SharePoint site on a time interval.  Yes it can, and its fairly simply just by using a Content Editor Webpart and some javascript.  Follow the steps below to auto refresh your SharePoint page/site.
1.  Edit your SharePoint site and add a Content Editor Webpart on your page.
2.  Edit the Content Editor Web Part and inside the Source Editor, copy the javascript code below.

<script>
var reloadTimer = null;
var sURL = unescape(window.location.pathname);
function setReloadTime(secs)
{if (arguments.length == 1)
   { if (reloadTimer) clearTimeout(reloadTimer);
       reloadTimer = setTimeout("setReloadTime()", Math.ceil(parseFloat(secs)*1000));
   }  
else   { reloadTimer = null;
     window.location=window.location;
     window.location.replace( sURL );
   }
}
setReloadTime(300);
</script>


3.  Set the setReloadTime(x) to x amount of seconds you would like to wait before refresh.
4.Hide the content Editor Webpart

Thursday, 29 May 2014

E-Mail Validation List Column in SharePoint

-->Go to List -->list settings -->Click Email Column-->Go Column Validation Type below Formula --> and Write Error message "Enter Correct Email"
=AND(ISERROR(FIND(" ",Email,1)),IF(ISERROR(FIND("@",Email,2)),
FALSE,AND(ISERROR(FIND("@",Email,FIND("@",Email,2)+1)),
IF(ISERROR(FIND(".",Email,FIND("@",Email,2)+2)),
FALSE,FIND(".",Email,FIND("@",Email,2)+2)
<
LEN
(Email)
))
))


SharePoint tenant opt-out for modern lists is retiring in 2019

We're making some changes to how environments can opt out of modern lists in SharePoint. Starting April 1, 2019, we're going to be...