Hook into Add menu link in Drupal 8 - menu

I need to hook into "Add menu link" form in Drupal 8 and make Description field required.
This is for main navigation. Any suggestion is appreciated.

I figured it out
// make description required for "Add menu link" form
if ($form_id == 'menu_link_content_menu_link_content_form') {
$form['description']['widget'][0]['value']['#required'] = true;
}

Related

Sharepoint 2013 Adding a add new event link in content editor

I would like to add a "Add New Event" link in a content editor web part to the calendar page. When clicked should open the default "new event" window to add an event. How can do that? what should be the link look like?
Thanks
Ganesh
If you want to open the form in the whole page, the link should be like this:
Add New Event
To open in a modal dialog:
function openDialog() {
var url = "<weburl>/Lists/<calendarlist>/NewForm.aspx";
var options = {
title: "Add New Event",
width: 400,
height: 600,
url: url
};
SP.UI.ModalDialog.showModalDialog(options);
}
Add New Event
Overwrite <weburl> with the web relative url and <calendarlist> with the relative url of the list (most of times the list name)
Example: https://mysiteurl/Lists/Calendar/NewForm.aspx
In a site page, click edit page and click on Add a Web Part.
Select your calendar list from Apps section in Categories.
Once your calendar is in your Site Page, click Add a Web Part again.
Select Content Editor Web part from Media and Contents section.
Inside Content Editor webpart click on "Click here to add new Contents"
From the ribbon, click on "Edit source".
[enter image description here][1]
Type or paste following code:
Add New Event
Lastly Click on Save page.

XPages Navigation - Updating Panels with Link onclick Events

I'm trying to deploy "Building a Configurable and Extensible XPages Navigation" I found in THE VIEW (I'm a subscriber):
http://www.eview.com/eview/volr6.nsf/articleURL/2012-09-building-a-configurable-and-extensible-xpages-navigation.
My design is very basic and traditional: two panels. In the left panel a Custom Control with the navigation as links. In the right panel an "Include Page" control for displaying XPages as a result of onclick events of the links in the left panel.
Problem: can't get the the right panel to update.
Have tried, in vain: passing sessionScope parameter with SSJS, partial updates, postScript with partialRefreshGet.
MY CODE:
My "almost" working version - needs a manual refresh/reload to actually display the desired XPage in the right panel's "Include Page" control.
Link onclick: sessionScope.showPage = "xspByYear.xsp"; AND Partial Update of right panel.
Right panel's "Include Page" - pageName AND onClientLoad (with Home as default):
var tmp = sessionScope.showPage;
if (tmp == null){
"xspHome.xsp";
} else {
tmp;
}
Comment: All Properties/pageName had an "$" added, not allowed to change to "#": "... cannot be a run time binding."
You can pass the "Include Page" control to a panel. Set an id to the panel and refresh the panel in the onclick event of the links (Partial Update).
<xp:panel id="panelToUpdate">
<xp:include pageName="/MyXPage.xsp" id="include1"></xp:include>
</xp:panel>

lotus notes: #Command(fileprint) with the print/page setup box

#Command([FilePrint]; "1"; ""; ""; ""; "printview";""; "";"";"")
I'm using this formula in an action button inside a view for printing all documents listed by the view.
I've looked in the Domino Designer but I didn't found any parameter for the page setup which I want to appear.
I appreciate your time.
You can use:
#Command([FilePageSetup]);
To display the page setup dialog just before the FilePrint command.
http://publib.boulder.ibm.com/infocenter/domhelp/v8r0/topic/com.ibm.designer.domino.main.doc/H_FILEPAGESETUP.html

Sharepoint2010 hiding "Edit Item" button in ribbon for a specific Custom List

I am using Share Point 2010, I have requirement where i create some Custom lists in feature activation by code and i have to hide "Edit Item" in ribbon for a specific Custom List
There are so many solutions available but they hide "Edit Item " button for all lists in site , but its not required in my case.
Thank i need your help .. pls
Jay Bhagatwala
Jay
Create UserControl with the following codebehind and add to to a delegate control via Feature using module:
SPRibbon ribbon = SPRibbon.GetCurrent(this.Page);
if (!Request.Url.ToString().ToLower().Contains("ListNameWhereWeHideButtons"))
return; // if it's not our list - do nothing
if (ribbon != null)
{
ribbon.TrimById("Ribbon.ListItem.New"); //hide new button
ribbon.TrimById("Ribbon.ListItem.Manage"); // hide edit button
}
}
I've uploaded my test project on the following URL (I hope it's not prohibited by the rules):
http://ge.tt/8TIqVX8

SharePoint Add New Item Button on Home Page

I'm building a bulletin board site (in 2010) and I'm sure this must be simple but again it doesn't seem so. Anyway on my default page I have a query webpart showing the latest items and what I need is just a button at the top of the page "Add new item" which would show the popup and allow users to complete the form just like it works on the display list items form.
I've looked at AllItems.aspx but can't even see the "Add new item" button to copy!
Any ideas?
Thanks
Dan
This is actually very easy. You need to know the address for your NewForm.aspx page. To make it look like a dialog box, you want to add IsDlg=1 to the query string. SharePoint has a built in JavaScript that can do all this for you. Below is an example of a button I created to open new help desk tickets.
//Handle the DialogCallback callback
function DialogCallback(dialogResult, returnValue){}
//Open the Dialog
function OpenNewDialog(){
var options = {
url:"/depts/is/helpdesk/Lists/Service%20Requests/NewForm.aspx?IsDlg=1",
width: 700,
height: 700,
dialogReturnValueCallback: DialogCallback
};
SP.UI.ModalDialog.showModalDialog(options);
}
You can also leave off the width and height options and the dialog window will size itself. For the HTML
<div style="text-align: center">
Open a new Service Request
</div>
How complicated is your query? If the query is only pulling from one list, you could put the filters into a view in the list and replace your query webpart with a List View Web Part (in the browser, select the webpart named after your list). In the List View Web Part properties, switch to your new view. By default, a List View Web Part includes an Add New Item link.
Now, it's a link and not a button. And it's in the footer of the webpart, not at the the top. If you really need a button at the top of the page, you could add a Content Editor Web Part and insert HTML for your own button. You should be able to reuse the Add New Item URL from AllItems.aspx. The URL should look something like this: http://mysite/_layouts/listform.aspx?PageType=8&ListId={21AA3D96-75EE-45CC-A153-D0FA7856DE67}&RootFolder=

Resources