Disable PowerApps button on list/document library - sharepoint

I wish to remove the PowerApps button from the command bar on e.g. document libraries on a site. But it does not seem to work. N.B. Automate/Flow button are removed / disable as expected.
My initial test was with a PnP template where I set the websettings nodes attr, like this:
<pnp:WebSettings Title="{parameter:SiteTitle}" DisableFlows="true" DisableAppViews="true"
But it did removed the PowerApps button.
Then I tried there PnP PowerShell snippets but without any luck:
$web = get-pnpweb
$web.DisableAppViews = $true
$web.DisableFlows = $true
$web.Update()
Invoke-PnPQuery
$ctx = Get-PnPContext
$ctx.Site.DisableAppViews = $true;
$ctx.Site.DisableFlows = $true;
$ctx.ExecuteQuery();
(Snippet pasted from https://www.cloudappie.nl/disabling-flow-powerapps-buttons/)
I’m petty sure this was working like 2 weeks ago. Any ideas why I can disable PowerApps button.

You could use spfx to upload custom css file to sharepoint online to hide special button.
Example on how to upload css file in spfx:
https://github.com/hugoabernier/react-application-injectcss
similar issue:
https://sharepoint.stackexchange.com/questions/280681/how-to-hide-the-button/280683#280683

Related

I want to change the color of the Sharepoint site to another custom color

I want to change the color of the Sharepoint site to another custom color or put a background image
We can use PnP PowerShell to achieve it.
Example:
Set-PnPTheme -ColorPaletteUrl _catalogs/theme/15/company.spcolor -BackgroundImageUrl 'style library/background.png'
Source Code: Set SharePoint Theme
More information: SharePoint site theming

Typo3 FAL show file browser popup in backend module

I have a site which shows a teaser (image+text) on all pages.
This should be editable from admin, so I created a small backend module (a simple form) where the admin should set the image and the text and save them in Typo3's registry db table:
This is how I save the text:
$request = $this->controllerContext->getRequest();
$arguments = $request->getArguments();
$registry = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance( 't3lib_Registry' );
$extKey = $request->getControllerExtensionKey();
$registry->set( $extKey, 'text', $arguments['settings']['text'] );
but I don't know how to add an "Add image" link to display the file browser and get the url/id of the selected file.
Any ideas?
Thanks.
In order to have a file picker you will need to have a TCA for a FAL field. A TCA is usually connected to a table and I wouldn't know of any implementation with the registry as a "storage backend".
This means you would have to create TCEForms yourself and then intercept the saving process. This is possible but rarely used and rather complicated, see an example here:
https://git.typo3.org/Packages/TYPO3.CMS.git/blob/TYPO3_4-5:/typo3/sysext/version/ws/workspaceforms.php
(for TYPO3 4.x, for 6.x the class names have to be adjusted)
So I would suggest that you extend the table pages with a field for text and a FAL field instead of trying to write an own backend module for this purpose.

How to change teamsite text layout programmatically?

I have a code that creates a teamsite. After that I add some web parts to wiki web part zone(rich content area). In SharePoint 2010 user can change a text layout of the rich content in page edit mode.
Is there any way to programmatically change the text layout of the rich text area? I would want to set "two columns with header"-layout after site creation has completed.
My site is created like this.
site = elevatedSite.SelfServiceCreateSite(params.....);
rootWeb = site.RootWeb;
rootWeb.ApplyWebTemplate("STS#0");
SPListItem currentItem = rootWeb.Item;
var xhtml = currentItem[SPBuiltInFieldId.WikiField] as string;
Now I can modify the xhtml string and save it back to the page. I have tried to change it so that it contains exatly the same html structure which have created by sharepoint itself, when changing the text layout. After that change, actually it is not recognized as "two columns with header"-layout in sharepoint. It is still default one-column layout. Is there anybody who knows is it possible to change the text layout of the rich text area programmatically?
I found answer from here http://donalconlon.wordpress.com/2010/05/04/sp2010-creating-a-wiki-page-using-the-om/. SharePoint stores the information about used layout to the hidden span-element in wiki page.
For example, this presents two column layout without the header or footer.
<span id="layoutsData" style="display: none">false,false,2</span>
first false = no header
second false = no footer
2 = two columns
I have been looking for some information on doing the same thing. I found this blog post that checks out the page, edits the content then publish and approves it.
SharePoint 2010 change page content data through Object Model / API – Console Application
If you need to modify pure HTML content, its better to use cutom IHttpHandler (wrapped in dll) and connect it to SharePoint via web.config. Is is also allowing to modify dynamic content like AJAX responses.

SharePoint 2010: This page is not using a valid page layout

SharePoint 2010
I have an enterprise wiki site, that I exported and imported from one farm to another. However, I exported it form a site collection root site, to a sub site in another site collection. When I browse to any page that was created with the Enterprise wiki template, I get the error:
This page is not using a valid page layout. To correct the problem, edit page settings and select a valid page layout."
The page layout is showing as Basic Page. And works ok for new pages created. How can I fix the page layout, that is in the existing pages?
Any thoughts?
Turns out it's a bug. If you import a publishing site, the pages do not have the correct link to the page layout. No way to fix this through the UI. I had to use PowerShell.
I followed Mahesh's Blog to this MS Support article and used the Manage Content and Structure tool to change the Page Layout. Quite strange (this error seems to be a downstream error from a page that failed to upgrade from SharePoint 2007 and had a XsltListViewWebPart which had an invalid GroupBy setting).
Below is a simpler /similar version of the code in the link copied in case the original goes away (I've added notes about what needs to be changed)
[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint")
[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint.Publishing")
$web = Get-SPWeb -Identity "http://web/you/are/modifying"; #Change web that you're modifying on this line
$spPubWeb = [Microsoft.SharePoint.Publishing.PublishingWeb]::GetPublishingWeb($web);
$pages = $spPubWeb.PagesList;
foreach($item in $pages.Items)
{
$pubPage = [Microsoft.SharePoint.Publishing.PublishingPage]::GetPublishingPage($item)
$url = new-object Microsoft.SharePoint.SPFieldUrlValue($pubPage.ListItem[[Microsoft.SharePoint.Publishing.FieldId]::PageLayout].ToString())
if($url -ne $null)
{
if($url.Url -match 'NameOfPageLayout') #Change Page layout name on this line
{
$newurl = new-object Microsoft.SharePoint.SPFieldUrlValue("http://new/rootweb/_catalogs/masterpage/NewPageLayout.aspx, NewPageLayoutName") #Change URL and name on this line
$pubPage.Name
$pubPage.CheckOut()
$pubPage.ListItem[[Microsoft.SharePoint.Publishing.FieldId]::PageLayout] = $newurl
$pubPage.ListItem.UpdateOverwriteVersion()
$pubPage.ListItem.File.CheckIn("Fixed URL to page layout.", [Microsoft.SharePoint.SPCheckinType]::MajorCheckIn);
}
}
}

Getting page status history in Sharepoint

I need to get all dates and people modifications to currenlty displayed page, all changes which have been published and end user can see difference between them.
My page is aspx connected to pageLayout in which is richhtmlfield with article.
How to do that? Is it possible to do that ?
If this is for Contributors while the page is in edit mode, they can select Tools > Version History from the toolbar. Otherwise, you can add a link on the page to Versions that is available to all users:
<a href="/sites/mysite/_layouts/Versions.aspx?list=[GUID]&ID=[ID]&FileName=%2Fsites%2Fmysite%2FPages%2FcurrentPage%2Easpx>Modifications</a>
You will need to fill in the values of the list, ID, FileName parameters manually. To generate the link automatically, I would build a custom page layout that generates the URL in Page_Load as follows:
RevisionHistoryAction versions = new RevisionHistoryAction();
string url = versions.NavigateUrl;
RevisionHistoryAction is in the Microsoft.SharePoint.Publishing.WebControls.EditingMenuActions namespace.

Resources