custom actions are not visible
-
08-12-2019 - |
Question
I have a custom action for the menu, but I can not see it. 1. I am site collection admin 2. I checked the feature and its there 3. I checked the package and is there 4. I checked the 14 hive and updated xml files are there when I update the solution.
What else should I check?
<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<CustomAction Id="SiteActionsToolbar" Rights="ApplyStyleSheets" GroupId="SiteActions" Location="Microsoft.SharePoint.StandardMenu" Sequence="1010" Title="Create New Workspace" Description="Create a new xx Workspace" ImageUrl="/_layouts/images/NewContentPageHH.png">
<UrlAction Url="_layouts/xx/CreateWorkspace.aspx"/>
</CustomAction>
<CustomAction Id="SiteActionsToolbar" Rights="ApplyStyleSheets" GroupId="SiteActions" Location="Microsoft.SharePoint.StandardMenu" Sequence="1020" Title="xx Access Request List" Description="View Access Requests for xx Teams Workspaces" ImageUrl="/_layouts/images/Permissions32.png">
<UrlAction Url="Lists/RequestAccessHome/AllItems.aspx"/>
</CustomAction>
</Elements>
Solution
Make sure you check your URLs. These URLs are relative to the current address, so in your CAs if you're inside a list, for example, your URL action won't go to the expected URL.
In other words, if your current URL is http://site/Lists/Calendar.aspx, your first CA will action to http://site/Lists/Calendar.aspx_layouts/xx/CreateWorkspace.aspx, which probaly isn't what you want, and will ruin any permission checking you may want to do too.
Instead, prepend ~site or ~sitecollection to the from of your URL action:
<UrlAction Url="~site/_layouts/xx/CreateWorkspace.aspx"/>
.b