<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>SharePoint Archives : Binary Bits</title>
	<atom:link href="https://blog.binarybits.net/tag/sharepoint/feed/" rel="self" type="application/rss+xml" />
	<link>https://blog.binarybits.net/tag/sharepoint/</link>
	<description>Bits &#38; Pieces - A blog by Kannan Balasubramanian</description>
	<lastBuildDate>Mon, 03 May 2021 10:50:10 +0000</lastBuildDate>
	<language>en-GB</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>
	<item>
		<title>View unpublished pages or draft pages or published pages in SharePoint</title>
		<link>https://blog.binarybits.net/view-unpublished-pages-or-draft-pages-or-published-pages-in-sharepoint/</link>
					<comments>https://blog.binarybits.net/view-unpublished-pages-or-draft-pages-or-published-pages-in-sharepoint/#comments</comments>
		
		<dc:creator><![CDATA[Kannan]]></dc:creator>
		<pubDate>Tue, 17 Mar 2020 10:15:20 +0000</pubDate>
				<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[draft]]></category>
		<category><![CDATA[pages]]></category>
		<category><![CDATA[Published]]></category>
		<category><![CDATA[Unpublished]]></category>
		<guid isPermaLink="false">https://blog.binarybits.net/?p=1183</guid>

					<description><![CDATA[<p>Sometimes it&#8217;s necessary to know the status of all the pages before a site is made live. It becomes especially difficult when a team works together on multiple pages and there are number of pages which might have not been published and site owner has to make sure all the pages are published. We will [&#8230;]</p>
<p>The post <a href="https://blog.binarybits.net/view-unpublished-pages-or-draft-pages-or-published-pages-in-sharepoint/">View unpublished pages or draft pages or published pages in SharePoint</a> appeared first on <a href="https://blog.binarybits.net">Binary Bits</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p><img decoding="async" class="wp-image-1160" style="width: 32px;" src="https://blog.binarybits.net/wp-content/uploads/2020/03/microsoft-sharepoint-logo.svg" alt="Microsoft SharePoint Logo"> Sometimes it&#8217;s necessary to know the status of all the pages before a site is made live. It becomes especially difficult when a team works together on multiple pages and there are number of pages which might have not been published and site owner has to make sure all the pages are published.</p>



<p>We will create a view which can help a site owner to view unpublished pages or draft pages or published pages in SharePoint.</p>



<p>The technique is using the &#8220;Version&#8221; column to determine the decimal part of the &#8220;Version&#8221; by subtracting the integer part from the &#8220;Version&#8221;. So if there is any decimal value in the &#8220;Version&#8221; then it&#8217;s in unpublished or draft state.</p>



<p>Do note that this technique depends upon the &#8220;Document Version History&#8221; settings being &#8220;Create major and minor (draft) versions&#8221; for that library.</p>



<figure class="wp-block-image size-full"><a href="https://blog.binarybits.net/wp-content/uploads/2020/03/power-bi-admin-settings-publish-to-web-1.png"><img decoding="async" src="https://blog.binarybits.net/wp-content/uploads/2020/03/power-bi-admin-settings-publish-to-web-1.png" alt="Document Version History" class="wp-image-1191"/></a><figcaption> Document Version History settings</figcaption></figure>



<p>This involves two steps</p>



<ol class="wp-block-list"><li>Add a calculated column which helps to determine the page state using version value.</li><li>Create a new view or update an existing view to display the created calculated column.</li></ol>



<h3 class="wp-block-heading">Create column to know the page status</h3>



<ol class="wp-block-list"><li>Create a new column and name it &#8220;PageStatus&#8221; (We will later rename it to &#8220;Page Status&#8221;).</li><li>Set the type to &#8220;Calculated&#8221;.</li><li>Add the below formula and save the column settings. (Note: The &#8220;Version&#8221; column will not be available in &#8220;Insert Column:&#8221; pane so just copy paste the formula.)</li></ol>



<div class="wp-block-codemirror-blocks-code-block code-block"><pre class="CodeMirror" data-setting="{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;null&quot;,&quot;mime&quot;:&quot;text/plain&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;lineNumbers&quot;:true,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:false,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;Plain Text&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;text&quot;}">=If((Version-INT(Version))&lt;&gt;0,&quot;Draft&quot;,&quot;Published&quot;)</pre></div>



<ol class="wp-block-list" start="4"><li> In the library settings, click on the column to edit.</li><li>Change the column name to &#8220;Page Status&#8221; and click &#8220;OK&#8221; button.</li></ol>



<figure class="wp-block-image size-full"><a href="https://blog.binarybits.net/wp-content/uploads/2020/03/sharepoint-folder-manage-access-menu.png"><img decoding="async" src="https://blog.binarybits.net/wp-content/uploads/2020/03/sharepoint-folder-manage-access-menu.png" alt="Create a column to show page status." class="wp-image-1186"/></a><figcaption>&#8220;Page Status&#8221; column creation</figcaption></figure>



<h3 class="wp-block-heading">Library view to show the page status</h3>



<p>We can either create a new view or modify an existing view to show the &#8220;Page Status&#8221;. For this all that needs to be done is add the &#8220;Page Status&#8221; column to the view.</p>



<figure class="wp-block-image size-full"><a href="https://blog.binarybits.net/wp-content/uploads/2020/03/image-5.png"><img fetchpriority="high" decoding="async" width="979" height="256" src="https://blog.binarybits.net/wp-content/uploads/2020/03/image-5.png" alt="" class="wp-image-1193" srcset="https://blog.binarybits.net/wp-content/uploads/2020/03/image-5.png 979w, https://blog.binarybits.net/wp-content/uploads/2020/03/image-5-300x78.png 300w, https://blog.binarybits.net/wp-content/uploads/2020/03/image-5-768x201.png 768w, https://blog.binarybits.net/wp-content/uploads/2020/03/image-5-705x184.png 705w" sizes="(max-width: 979px) 100vw, 979px" /></a><figcaption>Library view to show the &#8220;Page Status&#8221;</figcaption></figure>
<p>The post <a href="https://blog.binarybits.net/view-unpublished-pages-or-draft-pages-or-published-pages-in-sharepoint/">View unpublished pages or draft pages or published pages in SharePoint</a> appeared first on <a href="https://blog.binarybits.net">Binary Bits</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.binarybits.net/view-unpublished-pages-or-draft-pages-or-published-pages-in-sharepoint/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
			</item>
		<item>
		<title>Prevent file download in SharePoint</title>
		<link>https://blog.binarybits.net/prevent-file-download-in-sharepoint/</link>
					<comments>https://blog.binarybits.net/prevent-file-download-in-sharepoint/#respond</comments>
		
		<dc:creator><![CDATA[Kannan]]></dc:creator>
		<pubDate>Fri, 13 Mar 2020 05:38:23 +0000</pubDate>
				<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[Download]]></category>
		<category><![CDATA[Prevent]]></category>
		<guid isPermaLink="false">https://blog.binarybits.net/?p=1123</guid>

					<description><![CDATA[<p>Sometimes in SharePoint there will be a scenario where users shouldn&#8217;t download documents, but yet should be able to view the documents. In many of the sites it&#8217;s mentioned that this is not possible. But in reality as of March 2020, this is possible. Generally the permission level &#8220;View Only: Can view pages, list items, [&#8230;]</p>
<p>The post <a href="https://blog.binarybits.net/prevent-file-download-in-sharepoint/">Prevent file download in SharePoint</a> appeared first on <a href="https://blog.binarybits.net">Binary Bits</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p><img decoding="async" class="wp-image-1160" style="width: 0px;" src="https://blog.binarybits.net/wp-content/uploads/2020/03/microsoft-sharepoint-logo.svg" alt="Microsoft SharePoint Logo"><img decoding="async" class="wp-image-1160" style="width: 32px;" src="https://blog.binarybits.net/wp-content/uploads/2020/03/microsoft-sharepoint-logo.svg" alt="Microsoft SharePoint Logo"> Sometimes in SharePoint there will be a scenario where users shouldn&#8217;t download documents, but yet should be able to view the documents. In many of the sites it&#8217;s mentioned that this is not possible. But in reality as of March 2020, this is possible.</p>



<p>Generally the permission level &#8220;<em>View Only:  Can view pages, list items, and documents. Document types with server-side file handlers can be viewed in the browser but not downloaded.</em>&#8221; is not available by default. But the site collection feature &#8220;SharePoint Server Enterprise Site Collection features&#8221; when activated will enable this permissions level.</p>



<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow"><p>Note that this will work only for Microsoft Office files like Word, Excel, PowerPoint etc. Still users will be able to download other file type. The reason is SharePoint uses handler for viewing and editing Microsoft Office files which can prevent download.</p></blockquote>



<p>Perform the following steps to enable the permission level</p>



<ol class="wp-block-list"><li>Launch &#8220;Site collection features&#8221; under &#8220;Site Settings&#8221;.</li><li>Activate &#8220;SharePoint Server Enterprise Site Collection features&#8221;.</li><li>Go to the library&#8217;s settings and launch &#8220;Permissions for this document library&#8221;.</li><li> Enable unique permissions. </li><li>Then select the specific &#8220;SharePoint group&#8221; and click &#8220;Edit User Permissions&#8221;.</li><li>Now you should be able to see the permission level &#8221; View Only:  Can view pages, list items, and documents. Document types with server-side file handlers can be viewed in the browser but not downloaded.&#8221;</li><li>Check that permission and uncheck all other permissions.</li><li>Now all the users within that group will only be able to view the document in web-viewer and will not be able to download.</li></ol>



<h3 class="wp-block-heading">Before applying permission</h3>



<figure class="wp-block-image size-large"><a href="https://blog.binarybits.net/wp-content/uploads/2020/03/sharepoint-folder-direct-access.png"><img decoding="async" src="https://blog.binarybits.net/wp-content/uploads/2020/03/sharepoint-folder-direct-access.png" alt="" class="wp-image-1124"/></a><figcaption>The &#8220;Download&#8221; menu is visible. Clicking &#8220;Open&#8221; will open the file in web viewer.</figcaption></figure>



<h3 class="wp-block-heading">After applying permissions</h3>



<figure class="wp-block-image size-large"><a href="https://blog.binarybits.net/wp-content/uploads/2020/03/sharepoint-advanced-permissions-settings.png"><img decoding="async" src="https://blog.binarybits.net/wp-content/uploads/2020/03/sharepoint-advanced-permissions-settings.png" alt="" class="wp-image-1125"/></a><figcaption>The &#8220;Download&#8221; menu is not visible. Clicking &#8220;Open&#8221; will open the file in web viewer.</figcaption></figure>
<p>The post <a href="https://blog.binarybits.net/prevent-file-download-in-sharepoint/">Prevent file download in SharePoint</a> appeared first on <a href="https://blog.binarybits.net">Binary Bits</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.binarybits.net/prevent-file-download-in-sharepoint/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Remove the title banner from SharePoint modern page</title>
		<link>https://blog.binarybits.net/remove-the-title-banner-from-sharepoint-modern-page/</link>
					<comments>https://blog.binarybits.net/remove-the-title-banner-from-sharepoint-modern-page/#comments</comments>
		
		<dc:creator><![CDATA[Kannan]]></dc:creator>
		<pubDate>Mon, 09 Sep 2019 09:44:28 +0000</pubDate>
				<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[Banner]]></category>
		<category><![CDATA[Modern]]></category>
		<category><![CDATA[Title]]></category>
		<guid isPermaLink="false">https://blog.binarybits.net/?p=1049</guid>

					<description><![CDATA[<p>The title banner in the modern pages of SharePoint takes a lot of space. Even if you try to switch to &#8220;Plain&#8221; title layout, the title area still will take some space. To completely remove the space, you can run the following PnP PowerShell command with the ID of the page. For more about PnP [&#8230;]</p>
<p>The post <a href="https://blog.binarybits.net/remove-the-title-banner-from-sharepoint-modern-page/">Remove the title banner from SharePoint modern page</a> appeared first on <a href="https://blog.binarybits.net">Binary Bits</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p><img decoding="async" class="wp-image-1160" style="width: 32px;" src="https://blog.binarybits.net/wp-content/uploads/2020/03/microsoft-sharepoint-logo.svg" alt="Microsoft SharePoint Logo"> The title banner in the modern pages of SharePoint takes a lot of space.</p>



<figure class="wp-block-image"><a href="https://blog.binarybits.net/wp-content/uploads/2019/09/sharepoint-modern-page-1.png"><img decoding="async" width="1024" height="491" src="https://blog.binarybits.net/wp-content/uploads/2019/09/sharepoint-modern-page-1-1024x491.png" alt="" class="wp-image-1050" srcset="https://blog.binarybits.net/wp-content/uploads/2019/09/sharepoint-modern-page-1-1024x491.png 1024w, https://blog.binarybits.net/wp-content/uploads/2019/09/sharepoint-modern-page-1-300x144.png 300w, https://blog.binarybits.net/wp-content/uploads/2019/09/sharepoint-modern-page-1-768x369.png 768w, https://blog.binarybits.net/wp-content/uploads/2019/09/sharepoint-modern-page-1-705x338.png 705w, https://blog.binarybits.net/wp-content/uploads/2019/09/sharepoint-modern-page-1.png 1365w" sizes="(max-width: 1024px) 100vw, 1024px" /></a></figure>



<p>Even if you try to switch to &#8220;Plain&#8221; title layout, the title area still will take some space. </p>



<figure class="wp-block-image"><a href="https://blog.binarybits.net/wp-content/uploads/2019/09/sharepoint-modern-page-title-layouts.png"><img decoding="async" width="338" height="417" src="https://blog.binarybits.net/wp-content/uploads/2019/09/sharepoint-modern-page-title-layouts.png" alt="" class="wp-image-1051" srcset="https://blog.binarybits.net/wp-content/uploads/2019/09/sharepoint-modern-page-title-layouts.png 338w, https://blog.binarybits.net/wp-content/uploads/2019/09/sharepoint-modern-page-title-layouts-243x300.png 243w" sizes="(max-width: 338px) 100vw, 338px" /></a></figure>



<p>To completely remove the space, you can run the following PnP PowerShell command with the ID of the page.</p>



<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow"><p>For more about PnP PowerShell, visit <a rel="noreferrer noopener" aria-label="https://docs.microsoft.com/en-us/powershell/sharepoint/sharepoint-pnp/sharepoint-pnp-cmdlets?view=sharepoint-ps (opens in a new tab)" href="https://docs.microsoft.com/en-us/powershell/sharepoint/sharepoint-pnp/sharepoint-pnp-cmdlets?view=sharepoint-ps" target="_blank">this</a> link.</p></blockquote>



<div class="wp-block-codemirror-blocks-code-block code-block"><pre class="CodeMirror" data-setting="{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;powershell&quot;,&quot;mime&quot;:&quot;application/x-powershell&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;lineNumbers&quot;:true,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:false,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;PowerShell&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;powershell&quot;}">Set-PnPListItem -List SitePages –Identity &lt;id&gt; -Values @{&quot;PageLayoutType&quot;=&quot;Home&quot;}</pre></div>



<p>First connect to the site using the following command</p>



<div class="wp-block-codemirror-blocks-code-block code-block"><pre class="CodeMirror" data-setting="{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;powershell&quot;,&quot;mime&quot;:&quot;application/x-powershell&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;lineNumbers&quot;:true,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:false,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;PowerShell&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;powershell&quot;}">Connect-PnPOnline https://tenant.sharepoint.com/sites/site-where-the-page-exists  </pre></div>



<p>Then find out the ID of the page using the following command. This command assumes that the page is located within &#8220;SitePage&#8221; library.</p>



<div class="wp-block-codemirror-blocks-code-block code-block"><pre class="CodeMirror" data-setting="{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;powershell&quot;,&quot;mime&quot;:&quot;application/x-powershell&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;lineNumbers&quot;:true,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:false,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;PowerShell&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;powershell&quot;}">Get-PnPListItem -List SitePages</pre></div>



<p>Finally set the page&#8217;s layout type to &#8220;Home&#8221; by running the following command.</p>



<div class="wp-block-codemirror-blocks-code-block code-block"><pre class="CodeMirror" data-setting="{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;powershell&quot;,&quot;mime&quot;:&quot;application/x-powershell&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;lineNumbers&quot;:true,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:false,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;PowerShell&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;powershell&quot;}">Set-PnPListItem -List SitePages –Identity &lt;id&gt; -Values @{&quot;PageLayoutType&quot;=&quot;Home&quot;}</pre></div>



<p>Now the title area is totally gone.</p>



<figure class="wp-block-image"><a href="https://blog.binarybits.net/wp-content/uploads/2019/09/sharepoint-modern-page-2.png"><img loading="lazy" decoding="async" width="1024" height="492" src="https://blog.binarybits.net/wp-content/uploads/2019/09/sharepoint-modern-page-2-1024x492.png" alt="" class="wp-image-1052" srcset="https://blog.binarybits.net/wp-content/uploads/2019/09/sharepoint-modern-page-2-1024x492.png 1024w, https://blog.binarybits.net/wp-content/uploads/2019/09/sharepoint-modern-page-2-300x144.png 300w, https://blog.binarybits.net/wp-content/uploads/2019/09/sharepoint-modern-page-2-768x369.png 768w, https://blog.binarybits.net/wp-content/uploads/2019/09/sharepoint-modern-page-2-705x339.png 705w, https://blog.binarybits.net/wp-content/uploads/2019/09/sharepoint-modern-page-2.png 1364w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a></figure>
<p>The post <a href="https://blog.binarybits.net/remove-the-title-banner-from-sharepoint-modern-page/">Remove the title banner from SharePoint modern page</a> appeared first on <a href="https://blog.binarybits.net">Binary Bits</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.binarybits.net/remove-the-title-banner-from-sharepoint-modern-page/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>Get folder and files recursively in SharePoint using REST call</title>
		<link>https://blog.binarybits.net/get-folder-and-files-recursively-in-sharepoint-using-rest-call/</link>
					<comments>https://blog.binarybits.net/get-folder-and-files-recursively-in-sharepoint-using-rest-call/#respond</comments>
		
		<dc:creator><![CDATA[Kannan]]></dc:creator>
		<pubDate>Tue, 25 Sep 2018 10:14:22 +0000</pubDate>
				<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[Files]]></category>
		<category><![CDATA[Folders]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[REST]]></category>
		<guid isPermaLink="false">https://blog.binarybits.net/?p=988</guid>

					<description><![CDATA[<p>There was a simple requirement I came across for which a page should list all the files and folders in a SharePoint document library. I came up with a solution using ODATA call. Following is the REST call I made to get the list of all folder and files. /_api/web/Lists/GetByTitle(&#8216;Documents&#8217;)/Items?$select=FileLeafRef,FileRef&#38;$orderby=FileRef asc Following is the code [&#8230;]</p>
<p>The post <a href="https://blog.binarybits.net/get-folder-and-files-recursively-in-sharepoint-using-rest-call/">Get folder and files recursively in SharePoint using REST call</a> appeared first on <a href="https://blog.binarybits.net">Binary Bits</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>There was a simple requirement I came across for which a page should list all the files and folders in a SharePoint document library.</p>



<p>I came up with a solution using ODATA call. Following is the REST call I made to get the list of all folder and files.</p>



<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow"><p>/_api/web/Lists/GetByTitle(&#8216;Documents&#8217;)/Items?$select=FileLeafRef,FileRef&amp;$orderby=FileRef asc</p></blockquote>



<p>Following is the code which quickly prints them out in a table. Just add this code to a script editor web-part.<br>
Please make sure the URL is updated based on your site URL.</p>



<div class="wp-block-codemirror-blocks-code-block code-block"><pre class="CodeMirror" data-setting="{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;htmlmixed&quot;,&quot;mime&quot;:&quot;text/html&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;lineNumbers&quot;:true,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:false,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;HTML&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;html&quot;}">&lt;script src=&quot;//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js&quot;&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
    $.ajax({
        url: &quot;&lt;site url&gt;/_api/web/Lists/GetByTitle('Documents')/Items?$select=FileLeafRef,FileRef&amp;$orderby=FileRef asc&quot;,
        type: &quot;GET&quot;,
        headers: {
            &quot;Accept&quot;: &quot;application/json;odata=verbose&quot;
        },
        success: function (data, textStatus, xhr)
        {
            $.each(data.d.results, function (index, item)
            {
                // alert(&quot;The items in list are : &quot; + item.FileRef);
                $(&quot;#table1 tbody&quot;).append(&quot;&lt;tr&gt;&lt;td&gt;&quot; + item.FileRef + &quot;&lt;/td&gt;&lt;/tr&gt;&quot;);
            })
        },
        error: function r(xhr, textStatus, errorThrown)
        {
            alert(&quot;error:&quot; + JSON.stringify(xhr));
        }
    });
&lt;/script&gt;

&lt;table id=&quot;table1&quot;&gt;
    &lt;tbody&gt;&lt;/tbody&gt;
&lt;/table&gt;</pre></div>
<p>The post <a href="https://blog.binarybits.net/get-folder-and-files-recursively-in-sharepoint-using-rest-call/">Get folder and files recursively in SharePoint using REST call</a> appeared first on <a href="https://blog.binarybits.net">Binary Bits</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.binarybits.net/get-folder-and-files-recursively-in-sharepoint-using-rest-call/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Sharepoint disable drag and drop</title>
		<link>https://blog.binarybits.net/sharepoint-disable-drag-drop/</link>
					<comments>https://blog.binarybits.net/sharepoint-disable-drag-drop/#respond</comments>
		
		<dc:creator><![CDATA[Kannan]]></dc:creator>
		<pubDate>Tue, 12 Dec 2017 06:20:16 +0000</pubDate>
				<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[Drag and Drop]]></category>
		<guid isPermaLink="false">https://blog.binarybits.net/?p=970</guid>

					<description><![CDATA[<p>In some scenarios we might need to disabled drag and drop in SharePoint sites. The following code works when we need to disable a page with one document view. Add the html code in content editor web part where the document view is there. &#60;style type="text/css"&#62; /*-- Hide Drag &#38; Drop --*/ caption.ms-dragDropAttract { caption-side: [&#8230;]</p>
<p>The post <a href="https://blog.binarybits.net/sharepoint-disable-drag-drop/">Sharepoint disable drag and drop</a> appeared first on <a href="https://blog.binarybits.net">Binary Bits</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>In some scenarios we might need to disabled drag and drop in SharePoint sites.</p>
<p>The following code works when we need to disable a page with one document view.</p>
<p>Add the html code in content editor web part where the document view is there.</p>
<pre class="lang:xhtml decode:true  " title="SharePoint disable drag and drop">&lt;style type="text/css"&gt;
    /*-- Hide Drag &amp; Drop --*/    
    caption.ms-dragDropAttract {
        caption-side: bottom;
        display: none !important;
    }
&lt;/style&gt;

&lt;script type="text/javascript"&gt;
    /*-- Stop Drag &amp; Drop --*/
    ExecuteOrDelayUntilScriptLoaded(function() {
        g_uploadType = DragDropMode.NOTSUPPORTED;
        SPDragDropManager.DragDropMode = DragDropMode.NOTSUPPORTED;
        SPDragDropManager.DargDropMode.style.display = "none";
    }, "DragDrop.js");
&lt;/script&gt;</pre>
<p>For pages with multiple document libraries when you want to target a specific library prepend the id of the web part div and an underscore e.g. WebPartWPQ4_</p>
<pre class="lang:css decode:true ">#WebPartWPQ4_ms-dnd-dropbox{ display: none !important; }</pre>
<p>Source: https://sharepoint.stackexchange.com/questions/82805/how-can-i-disable-the-document-library-drag-and-drop-function</p>
<p>The post <a href="https://blog.binarybits.net/sharepoint-disable-drag-drop/">Sharepoint disable drag and drop</a> appeared first on <a href="https://blog.binarybits.net">Binary Bits</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.binarybits.net/sharepoint-disable-drag-drop/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Open SharePoint Office documents in modal dialog</title>
		<link>https://blog.binarybits.net/open-sharepoint-office-documents-modal-dialog/</link>
					<comments>https://blog.binarybits.net/open-sharepoint-office-documents-modal-dialog/#respond</comments>
		
		<dc:creator><![CDATA[Kannan]]></dc:creator>
		<pubDate>Mon, 13 Nov 2017 07:38:30 +0000</pubDate>
				<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[Modal]]></category>
		<category><![CDATA[Modal Dialog]]></category>
		<guid isPermaLink="false">https://blog.binarybits.net/?p=962</guid>

					<description><![CDATA[<p>Sometimes we need Microsoft Office documents to be opened in dialogs instead of SharePoint’s default behavior which is opening the document in the same window or tab. The following code helps in implementing this. Note: This code only works for office documents. For pdf documents look at the previous article. &#60;!-- Put this code below [&#8230;]</p>
<p>The post <a href="https://blog.binarybits.net/open-sharepoint-office-documents-modal-dialog/">Open SharePoint Office documents in modal dialog</a> appeared first on <a href="https://blog.binarybits.net">Binary Bits</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Sometimes we need Microsoft Office documents to be opened in dialogs instead of SharePoint’s default behavior which is opening the document in the same window or tab.</p>
<p>The following code helps in implementing this.</p>
<p>Note: This code only works for office documents. For pdf documents look at the previous article.</p>
<pre title="Open SharePoint Office documents in modal dialog" class="lang:js decode:true ">&lt;!-- Put this code below the list view web part --&gt;
&lt;script type="text/javascript" src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-3.2.1.min.js"&gt;
&lt;/script&gt;
&lt;script type="text/javascript"&gt;
    $hrefVal = $("a[onclick*='return DispEx'][target!='_blank']").attr("href");
    $siteUrl = _spPageContextInfo.webServerRelativeUrl;

    $("a[onclick*='return DispEx'][target!='_blank']")
        .removeAttr("onclick")
        .attr("href", "javascript:OpenDocumentInDialogue(\"" + $siteUrl + "/_layouts/WopiFrame.aspx?action=default&amp;sourcedoc=" + $hrefVal + "\")");

    function OpenDocumentInDialogue(href) {
        var o;
        $("body").append("&lt;div id='docTemp' style='min-height:600px;min-width:800px;height:100%;overflow:hidden'&gt;&lt;object data='" + href + "' width='100%' height='100%'&gt;&lt;/object&gt;&lt;/div&gt;");
        o = {};
        o.html = $("#docTemp")[0];
        o.showMaximized = true;
        o.title = href.substring(href.lastIndexOf("/") + 1);
        o.dialogReturnValueCallback = OpenDocumentinDlgCallback;
        SP.UI.ModalDialog.showModalDialog(o);
    }

    function OpenDocumentinDlgCallback() {
        // do something here when the dialog closes
    }
&lt;/script&gt;</pre>
<p>&nbsp;</p>
<p>The post <a href="https://blog.binarybits.net/open-sharepoint-office-documents-modal-dialog/">Open SharePoint Office documents in modal dialog</a> appeared first on <a href="https://blog.binarybits.net">Binary Bits</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.binarybits.net/open-sharepoint-office-documents-modal-dialog/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Open SharePoint PDF documents in modal dialog</title>
		<link>https://blog.binarybits.net/open-sharepoint-pdf-documents-in-modal-dialog/</link>
					<comments>https://blog.binarybits.net/open-sharepoint-pdf-documents-in-modal-dialog/#respond</comments>
		
		<dc:creator><![CDATA[Kannan]]></dc:creator>
		<pubDate>Mon, 13 Nov 2017 05:43:59 +0000</pubDate>
				<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[Dialog]]></category>
		<category><![CDATA[Modal]]></category>
		<category><![CDATA[Modal Dialog]]></category>
		<guid isPermaLink="false">https://blog.binarybits.net/?p=958</guid>

					<description><![CDATA[<p>Sometimes we need PDF documents to be opened in dialogs instead of SharePoint&#8217;s default behavior which is opening the document in the same window or tab. The following code helps in implementing this. Note: This code only works for PDF documents. For office documents look at the next article. &#60;script type="text/javascript" src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-3.2.1.min.js"&#62;&#60;/script&#62; &#60;script type="text/javascript"&#62; $("a[href$='.pdf']").each(function() [&#8230;]</p>
<p>The post <a href="https://blog.binarybits.net/open-sharepoint-pdf-documents-in-modal-dialog/">Open SharePoint PDF documents in modal dialog</a> appeared first on <a href="https://blog.binarybits.net">Binary Bits</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Sometimes we need PDF documents to be opened in dialogs instead of SharePoint&#8217;s default behavior which is opening the document in the same window or tab.</p>
<p>The following code helps in implementing this.</p>
<p>Note: This code only works for PDF documents. For office documents look at the next article.</p>
<pre title="Open document links in SharePoint modal dialog" class="lang:js decode:true">&lt;script type="text/javascript" src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-3.2.1.min.js"&gt;&lt;/script&gt;
&lt;script type="text/javascript"&gt;
    $("a[href$='.pdf']").each(function() {
        $(this).removeAttr("onclick").attr("href", "javascript:OpenDocumentInDialogue(\"" + this.href + "\")");
    });

    function OpenDocumentInDialogue(href) {
        var o;
        $("body").append("&lt;div id='docTemp' style='min-height:600px;min-width:800px;height:100%;overflow:hidden'&gt;&lt;object data='" + href + "' width='100%' height='100%' type='application/pdf' &gt;&lt;/object&gt;&lt;/div&gt;");
        o = {};
        o.html = $("#docTemp")[0];
        o.showMaximized = true;
        o.title = href.substring(href.lastIndexOf("/") + 1);
        o.dialogReturnValueCallback = OpenDocumentInDialogueCallback;
        SP.UI.ModalDialog.showModalDialog(o);
    }

    function OpenDocumentInDialogueCallback() {
        // Do something here when the dialog closes
    }
&lt;/script&gt;</pre>
<p>&nbsp;</p>
<p>The post <a href="https://blog.binarybits.net/open-sharepoint-pdf-documents-in-modal-dialog/">Open SharePoint PDF documents in modal dialog</a> appeared first on <a href="https://blog.binarybits.net">Binary Bits</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.binarybits.net/open-sharepoint-pdf-documents-in-modal-dialog/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Displaying SharePoint&#8217;s &#8220;Please wait&#8230;&#8221; or &#8220;Working on it&#8230;&#8221; dialog box</title>
		<link>https://blog.binarybits.net/displaying-sharepoints-please-wait-or-working-on-it-dialog-box/</link>
					<comments>https://blog.binarybits.net/displaying-sharepoints-please-wait-or-working-on-it-dialog-box/#respond</comments>
		
		<dc:creator><![CDATA[Kannan]]></dc:creator>
		<pubDate>Fri, 03 Nov 2017 06:31:10 +0000</pubDate>
				<category><![CDATA[SharePoint]]></category>
		<guid isPermaLink="false">https://blog.binarybits.net/?p=947</guid>

					<description><![CDATA[<p>The following code helps in displaying the &#8220;Working on it&#8230;&#8221; dialog box available in SharePoint 2013 or SharePoint Online. Before you being the background operation, call the function &#8220;RequestStarted&#8220;. Once the background operation has been completed, call the function &#8220;RequestEnded&#8220;. function RequestEnded(sender, args) { try { waitDialog.close(); waitDialog = null; } catch (ex) {} }; [&#8230;]</p>
<p>The post <a href="https://blog.binarybits.net/displaying-sharepoints-please-wait-or-working-on-it-dialog-box/">Displaying SharePoint&#8217;s &#8220;Please wait&#8230;&#8221; or &#8220;Working on it&#8230;&#8221; dialog box</a> appeared first on <a href="https://blog.binarybits.net">Binary Bits</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>The following code helps in displaying the &#8220;Working on it&#8230;&#8221; dialog box available in SharePoint 2013 or SharePoint Online.</p>
<p>Before you being the background operation, call the function &#8220;<em>RequestStarted</em>&#8220;. Once the background operation has been completed, call the function &#8220;<em>RequestEnded</em>&#8220;.</p>
<pre class="lang:js decode:true" title="SharePoint Working on it code">function RequestEnded(sender, args) {
    try {
        waitDialog.close();
        waitDialog = null;
    } catch (ex) {}
};

function RequestStarted(sender, args) {
    var waitDialog;
    ExecuteOrDelayUntilScriptLoaded(ShowWaitDialog, "sp.js");
};

function ShowWaitDialog() {
    try {
        if (waitDialog == null) {
            waitDialog = SP.UI.ModalDialog.showWaitScreenWithNoClose('Processing...', 'Please wait while request is in progress...', 120, 440);
        }
    } catch (ex) {}
};</pre>
<p>Source: <a href="https://sharepoint.stackexchange.com/questions/88905/javascript-how-to-reuse-the-working-on-it-pop-in" target="_blank" rel="noopener">Sharepoint Stackexchange</a></p>
<p>The post <a href="https://blog.binarybits.net/displaying-sharepoints-please-wait-or-working-on-it-dialog-box/">Displaying SharePoint&#8217;s &#8220;Please wait&#8230;&#8221; or &#8220;Working on it&#8230;&#8221; dialog box</a> appeared first on <a href="https://blog.binarybits.net">Binary Bits</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.binarybits.net/displaying-sharepoints-please-wait-or-working-on-it-dialog-box/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Change new item text in SharePoint</title>
		<link>https://blog.binarybits.net/change-new-item-text-sharepoint/</link>
					<comments>https://blog.binarybits.net/change-new-item-text-sharepoint/#respond</comments>
		
		<dc:creator><![CDATA[Kannan]]></dc:creator>
		<pubDate>Mon, 17 Jul 2017 10:52:31 +0000</pubDate>
				<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[New item]]></category>
		<guid isPermaLink="false">https://blog.binarybits.net/?p=916</guid>

					<description><![CDATA[<p>The following script changes the &#8220;new item&#8221; link button in SharePoint view form to whatever we desire. Add either of the script to content editor web part. Plain JavaScript version: (This code assumes that there is only one &#8220;new item&#8221; text in the entire page.) &#60;script&#62; document.addEventListener("DOMContentLoaded", function () { ExecuteOrDelayUntilScriptLoaded(function () { var ReRenderListView_old [&#8230;]</p>
<p>The post <a href="https://blog.binarybits.net/change-new-item-text-sharepoint/">Change new item text in SharePoint</a> appeared first on <a href="https://blog.binarybits.net">Binary Bits</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>The following script changes the &#8220;new item&#8221; link button in SharePoint view form to whatever we desire.</p>
<p>Add either of the script to content editor web part.</p>
<p><strong>Plain JavaScript version: </strong>(This code assumes that there is only one &#8220;new item&#8221; text in the entire page.)</p>
<pre class="lang:xhtml decode:true ">&lt;script&gt;
    document.addEventListener("DOMContentLoaded",
        function () {
            ExecuteOrDelayUntilScriptLoaded(function () {
                var ReRenderListView_old = ReRenderListView
                ReRenderListView = function (b, l, e) {
                    ReRenderListView_old(b, l, e)
                    changeText()
                }
            }, "inplview.js")
            changeText()
        }
    );

    function changeText() {
        var element = document.querySelector('#idHomePageNewItem span:nth-child(2)')
        element ? (element.innerHTML = "Add item") : null
    }

&lt;/script&gt;</pre>
<p><strong>jQuery version: </strong>(This code can replace any number of &#8220;new item&#8221; text)</p>
<pre class="lang:xhtml decode:true">&lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js"&gt;&lt;/script&gt;

&lt;script&gt;
    $(document).ready(function () {

        var spans = document.getElementsByTagName("span");
        for (var i = 0; i &lt; spans.length; i++) {
            if (spans[i].innerHTML == "new item") {
                spans[i].innerHTML = "add item";
                break;
            }
        }

    });

&lt;/script&gt;</pre>
<p>Source: <a href="https://sharepoint.stackexchange.com/questions/193726/sharepoint-2013-designer-changing-text-of-new-item-for-custom-list" target="_blank">sharepoint.stackexchange.com</a></p>
<p>The post <a href="https://blog.binarybits.net/change-new-item-text-sharepoint/">Change new item text in SharePoint</a> appeared first on <a href="https://blog.binarybits.net">Binary Bits</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.binarybits.net/change-new-item-text-sharepoint/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Hide SharePoint list column</title>
		<link>https://blog.binarybits.net/hide-sharepoint-list-column/</link>
					<comments>https://blog.binarybits.net/hide-sharepoint-list-column/#respond</comments>
		
		<dc:creator><![CDATA[Kannan]]></dc:creator>
		<pubDate>Thu, 13 Jul 2017 07:18:40 +0000</pubDate>
				<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[Hide Column]]></category>
		<guid isPermaLink="false">https://blog.binarybits.net/?p=908</guid>

					<description><![CDATA[<p>Sometimes we need to hide specific SharePoint columns in a list view webpart. The following code will help with that. Make sure this code is placed in a JS file and referenced using JSLink webpart property. Just replace the HideColumn function&#8217;s array parameters [&#8220;Title&#8221;, &#8220;Created By&#8221;] with necessary column&#8217;s display names. (function () { var overrideCurrentContext [&#8230;]</p>
<p>The post <a href="https://blog.binarybits.net/hide-sharepoint-list-column/">Hide SharePoint list column</a> appeared first on <a href="https://blog.binarybits.net">Binary Bits</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Sometimes we need to hide specific SharePoint columns in a list view webpart. The following code will help with that.<br />
Make sure this code is placed in a JS file and referenced using JSLink webpart property.<br />
Just replace the <em>HideColumn</em> function&#8217;s array parameters <em>[&#8220;Title&#8221;, &#8220;Created By&#8221;]</em> with necessary column&#8217;s display names.</p>
<pre class="lang:js decode:true" title="Hide SharePoint Columns">(function () {
    var overrideCurrentContext = {};
    overrideCurrentContext.Templates = {};
    overrideCurrentContext.OnPostRender = PostRenderer;
    SPClientTemplates.TemplateManager.RegisterTemplateOverrides(overrideCurrentContext);
})();

function PostRenderer(ctx) {
    HideColumn(["Title", "Created By"],true);
}

function HideColumn(columns, hideOnlyHeader) {
    columns.forEach(function(columnName) {
        headerParentFirstNode = document.querySelectorAll("[displayname='" + columnName + "']")[0];
        if (headerParentFirstNode != undefined) {
            var header = headerParentFirstNode.parentNode;
            header.style.display = "none";
            if (!hideOnlyHeader) {
                var index = [].slice.call(header.parentNode.children).indexOf(header) + 1;
                for (var i = 0, cells = document.querySelectorAll("td:nth-child(" + index + ")"); i &lt; cells.length; i++) {
                    cells[i].style.display = "none";
                }
            }
        }
    });
}</pre>
<p>&nbsp;</p>
<p>The post <a href="https://blog.binarybits.net/hide-sharepoint-list-column/">Hide SharePoint list column</a> appeared first on <a href="https://blog.binarybits.net">Binary Bits</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.binarybits.net/hide-sharepoint-list-column/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>

<!--
Performance optimized by W3 Total Cache. Learn more: https://www.boldgrid.com/w3-total-cache/?utm_source=w3tc&utm_medium=footer_comment&utm_campaign=free_plugin

Page Caching using Disk: Enhanced 
Minified using Disk

Served from: blog.binarybits.net @ 2026-04-23 21:41:35 by W3 Total Cache
-->