Showing posts with label SharePoint Designer. Show all posts
Showing posts with label SharePoint Designer. Show all posts

Wednesday, March 17, 2021

unable to install SP1 for my sharepoint designer, error “The expected version of the product was not found on the system”

Open Command Prompt use below command


C:\path_of_download_directory\spdsp2013-kb2817441-fullfile-x86-en-us.exe  PACKAGE.BYPASS.DE

Wednesday, July 13, 2016

How to get friendly URL of the current page in Sharepoint

string url = HttpContext.Current.Request.Uri.OriginalString;
TaxonomyNavigationContext class ontains several properties which will help you to work with friendly URLs programmatically,
For Example:
 HasFriendlyUrl and ResolvedDisplayUrl (all properties can be found here).
you can get friendly URL using the following code:

  string url = "";
if (TaxonomyNavigationContext.Current != null &&
     TaxonomyNavigationContext.Current.HasFriendlyUrl)
 {
     url = SPUtility.GetFullUrl(SPContext.Current.Site,
          TaxonomyNavigationContext.Current.ResolvedDisplayUrl);
  }

Monday, June 20, 2016

Content editor webpart overrides Sharepoint CSS

 CSS, Selectors and its rules for CSS Specificity and you will be able to master any CSS problem.

In your scenario you can wrap your content in a DIV unique  selectors ID

<div id='myCEWP'>
  <H1>Hello World!</H1>
</div>
And then apply your CSS only to that one H1 in the DIV :

<style>
   #myCEWP > H1 {
     color:green;
   }
</style>

Thursday, June 9, 2016

How do I know if the page is in Edit Mode from JavaScript?


Server Side Code: SPContext.Current.FormContext.FormMode var inDesignMode = document.forms[MSOWebPartPageFormName].MSOLayout_InDesignMode.value; if (inDesignMode == "1") { // page is in edit mode } else { // page is in browse mode } <input type="hidden" name="MSOLayout_InDesignMode" id="MSOLayout_InDesignMode" value="1" /> Update: for wiki pages, you will need _wikiPageMode parameter: var wikiInEditMode = document.forms[MSOWebPartPageFormName]._wikiPageMode.value; if (wikiInEditMode == "Edit") { // wiki page is in edit mode } else { // wiki page is not in edit mode } CSOM or ECMA Script: SP.Ribbon.PageState.Handlers.isInEditMode() Returns true or false. I use this in publishing pages.

Friday, May 20, 2016

Hide/Show field on list form based on value from another field SharePoint 2013

<script src="/Shared%20Documents/jquery-1.10.2.min.js"></script> //Edit your correct path
<script src="/Shared%20Documents/sputility.min.js"></script> //Edit your correct path

<script>
// wait for the window to load
$(document).ready(function () {

    var WorskspaceSetupField = SPUtility.GetSPField('WorkspaceSetup');

    var showOrHideField = function() {
        var workspaceSetupFieldValue = WorskspaceSetupField.GetValue();

        if(workspaceSetupFieldValue  == 'No') {
            SPUtility.HideSPField('LaptopSetup');
        }
        else {
            SPUtility.ShowSPField('LaptopSetup');
        }
    };

    // run at startup (for edit form)
    showOrHideField();

    // make sure if the user changes the value we handle it
    $(WorskspaceSetupField.Dropdown).on('change', showOrHideField);
});
</script>