SharePoint how to add button to Navbar in List Template? - sharepoint

I am trying to integrate the SharePoint extension in Teams and can't find a solution, to add a Label, Button or other type of Link to the NavBar.
The list i used was a generated with a template.
I tried to connect the different types of lists, with a homepage which is automatically generated in SharePoint.
After i redesigned the homepage, added the different links in a hero and connected the SharePoint site to Teams, i saw that that after clicking the link which led me to the list i could not go back to the homepage anymore.
The only way to access the homepage again was via dropdown on IT-Tickets and reload tab or closing it entirely.
The question is, how can i add an Element, after Open in SharePoint which links me back to the homepage ?

You cannot add a link to SharePoint list command bar using SharePoint out of the box capabilities.
You have to develop a SPFx ListView Command Set extension to add a link or button to SharePoint list command bar:
Documentation: Build your first ListView Command Set extension

Related

Customizing a modern page using SpFx

I want to transform a classic site into a modern experience and I have the following customization, done on a classic list form.
The page contains two Webparts:
XsltListViewWebPart to display the list of items
ContentEditorWebPart to fetch some summary data
Problem :
The SPFx extension used to replace the default rendering of the list works only on the allitems.aspx page (it is not working on my custom page which contains ListWebpart)
I need to know how to be able to make SPFx extension working on that ListWebpart.
Or if it is possible to add a client side webpart inside my allitems.apx page.
We can't 'Edit' OOB modern list view currently.
When you add list view to a modern page, you could deploy react-script-editor to your tenant so you could add this webpart to modern page which works like script editor webpart in classic view.

SharePoint Online Hub Sites Navigation - top level menu item with no hyperlink

On the hub site top navigation, I cannot find a way to add a menu item without a link.
On all of the other SharePoint online menu editors, you can leave the URL blank and it will make the new item a label without a hyperlink. However, in the hub sites top navigation, if you leave the URL blank, the "OK" button is disabled. If you add "#" in the URL, it links to the site home page. This is a problem because users automatically click on a menu item when they want to see the children, resulting in a page reload.
More details here: https://techcommunity.microsoft.com/t5/SharePoint/Hub-site-navigation-top-level-requires-URL/m-p/226427#M20428
Has anyone been able to successfully add a menu to their hub site with top level navigation items not linking to anywhere?
Yes, that is not supported OOTB. A valid URL seems like a must.
To get around this issue, you can make use of SPFx extensions based on links in term store.
After that, you can delete all the links in your hub site and then deploy this extension to sites associated to your hub. This will provide you will a consistent top navigation across site collections.
GitHub Link - Tenant Global NavBar Application Customizer
Use PS script from - Apply SPFx extensions to SharePoint Hub Sites using PnP PowerShell
When you deploy this extension, if the term has no link it acts like a label.
If the term has child links, it will open a dropdown showing those child links which can then be clicked.
Seems like an overkill but there seems to be no other option.
You can always guide and train your end users or content owners to hover the links and the dropdown for child links besides it before clicking, but it will require a mentality change on their part !

How to make document library in top level visible to subsites

I'd like to ask if you came up with a solution that will allow for subsites to access a centralized document library at the parent level. I'm still trying to no avail. I've tried doc library templates, views, Doc Center and the best method i have OOTB is a page view web part on the subsites page display a view from the parents library. (by the way to remove the ribbon, append ?IsDlg=1 to the url and the ribbons hidden) cool tip. Say will you give be a Y/N on a solution that will allow one to keep a set of documents in the doc center and surface them in the sub-site.
There are another option without such hard coding. You can open any view of your document library, as mentioned earlier AllItems.aspx for example with SharePoint Designer. Open it for editing in advanced mode (there are option when you click right mouse button on file in SP Designer). Then just point mouse cursor inside web part and chose in ribbon web parts, Add to Site gallery, see the picture. Fill in name of new web part. That is all, now you can add this web part on any page on any web site from webpart gallery through the user interface or through the SP Designer by clicking Insert, Web Part in the ribbon on any page.
You can do this by editing the AllItems.aspx (or other view page) and scraping off the WebPartPages:ListViewWebPart and pasting it into a page on the subsite.
This will give you an error "List does not exits The page you selected contains a list that does not exist."
Then you need to get the WebID for the root site (where you took the ListViewWebpart from and replace the part of the webpart that looks like this:
<WebId xmlns="http://schemas.microsoft.com/WebPart/v2/ListView">00000000-0000-0000-0000-000000000000</WebId>
with (for example)
<WebId xmlns="http://schemas.microsoft.com/WebPart/v2/ListView">7b04dee8-b120-4dee-abea-28b77316ec7d</WebId>

Do not show the web part of the SPList in SharePoint 2007

I have a programmatically created SPList with custom content type and it is added to the quick launch. Every time I click on the link on the quick launch, the page appears with a web part that shows the content of the list.
I do not want that... I wanted the web part gone so when I visit the page, there is no web part on it at all. Is there any ways of doing this programmatically? I do not want to have to manually delete the web part.
Thanks.
You can specify false for "on quick launch" in the list definition, or from code, if you don't want to have the list view page link in quick launch. Why not just create a web-part page without the list view web-part on it, and add a link to that page to quick launch? Do you need to change the allitems page?

Accidentally deleted a webpart, how can I get it back

I have deleted "New comment" webpart on the Blog Post detailed Page on the my SharePoint blog site, I am unable to find it in the webpart list.
How can I get undo / add the webpart back.
If you have clicked the X button in the top-right corner of the web part, it is simply closed. You can get it back as follows:
Click on Actions, Edit Page
Click Add a web part
Click Advanced Web Part Gallery in the top bottom-right corner of the dialog
Click on Closed Web Parts in the tool pane on the right
Drag the closed web part from the tool pane back onto the page
If you have actually used the drop-down menu on the web part and clicked Delete, it really is deleted. If you have check-in/out available to the page you can go back to a previous version to restore it. Otherwise you will need to restore from backup if you have one.
A very usefull way to see all web parts on the page, including closed ones, is the Web Part Maintenance Page, which is accessed by simply adding '?Contents=1' to the page address
I faced the same problem (it was my mistake :(), but I am able to get my “New Comment” webpart back on the page by using SharePoint Designer.
Steps to get “New Comment” webpart back on the page
Create New blog site just to get “New Comment” list form Webpart
Open Newly created blog site in SharePoint designer and address]/ Lists/Posts/Post.aspx page and
Copy the full XSLT code of “New Comment” list form Webpart
Go back to your production blog site and place the copied XSLT just after “comments” list view Webpart on the page
Provide “your comments list GUID” under List Name property of the copied XSLT
Save and close.
That’ it. Your “New comment” Webpart is back on the page
Regards,
Moorthy Annadurai
"If you have actually used the drop-down menu on the web part and clicked Delete, it really is deleted."
Here is a solution that does not require SP Designer and fixes the problem in a couple minutes.
In fact, it is only the Default View associated to the webpart that is deleted. Click on View All Site Content. Then on the defective library link. It will open the listedit.aspx page. Go down to the Views section. Select another view or create a new view and make it the one by default. That's it. You are back in business. Of course, you need to correct the library link in the Quick Launch section.
Regards,
Pierre Audette
In my case it was a "Summary Link Web Part" that was added to a Document Library and the user accidentally "x'd" out off it. I found the "closed" web part by doing the following:
Click on "Site Actions | Edit Page"
Click on "Add a Web Part"
In the "Categories" list box on the left the last folder is "Closed Web Parts". Select the Web Part and re-add it.

Resources