0

I am working on a Team Site collection inside sharepoint 2013.

now i am trying to deliver the following requirements:-

  1. Inside our root team site home page. to add 5 left-side links for showing instruction inside a popup windows .

  2. the links will be "HR Procedures", "Dress code", etc..

  3. when users click on one of the link a popup window will open showing the instructions.

enter image description here

Now i tried the following:-

  • i created a new Wikipage library.
  • inside the advance settings i set to open item in a dialog:-

enter image description here

  • then i created 5 pages inside the wikilibrary, and i add links to the pages inside the left-side links.

  • but when users click on the links the instruction pages will be shown directly inside the main windows and not inside a dialog.

so can anyone adivce on this please ? should i use JavaScript to achieve what i am looking for ??

  • 1
    I would use javascript with the SP.UI.ModalDialog.showModalDialog(options) Method msdn.microsoft.com/en-us/library/office/… – Erin L Nov 18 '16 at 15:27
  • 1
    As far as I am aware, the "Launch forms in a dialog" settings for lists/libraries specifically applies to the New, Edit and Display forms for the library. A Wikipage in a library would count as content, and not a form. If you were to select one of your Wikipages and choose to "view properties", that would open in a dialog. – Dylan Cristy Nov 18 '16 at 15:27
  • @DylanCristy so what are the options i am left with ? should i consider another list type not of type wiki page ? or i should keep using the wiki page and try doing my point using JavaScript ?? – john Gu Nov 18 '16 at 15:29
  • @ErinL so i need to add the related javaScript inside a script editor web part ? not sure how to attach the related javaScritp inside the link you provide to my links?? – john Gu Nov 18 '16 at 15:30
  • @DylanCristy now i have noted is that even if i add a library which uses forms (such as announcement) this will not work.as the display form will not be opened inside popup if i add a link to the item inside the left-side navigation... it will only open on a dialog if i am inside the list views and i click on the item. – john Gu Nov 18 '16 at 15:37
1

Try to add the following code at script editor on your page to open a link in modal dialog

< script >
function openDialog(pageUrl) {
var options = {
url: pageUrl,
title: 'Title of the Dialog',
allowMaximize: false,
showClose: true,
width: 500,
height: 500
};
SP.SOD.execute('sp.ui.dialog.js', 'SP.UI.ModalDialog.showModalDialog', options);
}
</ script >
<a href="#" onclick="openDialog('http://SharePointSite/Lists/WebEvents/NewForm.aspx');">Central Admin</a>

For more details Open a link via Modal Dialog in SharePoint

[Update]

As a workaround you can add this code at you script editor in your home page

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script>

<script >
function openDialog(pageUrl) {
var options = {
url: pageUrl,
title: 'Qassas Dialog',
allowMaximize: false,
showClose: true,
width: 500,
height: 500
};
SP.SOD.execute('sp.ui.dialog.js', 'SP.UI.ModalDialog.showModalDialog', options);
}

$(".ms-core-listMenu-item").click(function(e) { 

openDialog(e.target.href);
//$(".menu-item").removeAttr('href');

return false;

 });
</script >
  • 1
    are you mean the left navigation ? – Mohamed El-Qassas MVP Nov 18 '16 at 15:44
  • 1
    yes exactly the built-in left side navigation links.. – john Gu Nov 18 '16 at 15:45
  • 2
    @M.Qassas I'm thinking js to loop through links in the quick launch and override them with onclicks. What are you thinking? – Erin L Nov 18 '16 at 18:15
  • 1
    @ErinL you are right and that what I tried to do now , but if you already have this code I will appreciate if you post it as answer to help John faster , thanks for your cooperation – Mohamed El-Qassas MVP Nov 18 '16 at 21:10
  • 2
    I don't have it. It was just the only solution I could think of. – Erin L Nov 18 '16 at 21:29
-1

By Left side link you mean the quick launch/current navigation?

Any of the links you put there can have the "open link in a new window" enter image description here

Any link you place in a page with INSERT - LINK can have the "open in a new page" inside the link settings

enter image description here

  • but "open in new window" will either open the link inside a new tab, or inside a new browser based on users' browsers setting.. it does not mean open in popup. and yes when i am talking about left side navigation i mean the quick luck navigations.. – john Gu Nov 18 '16 at 16:50
  • when you install software to block pop-ups, they do block also automatic new windows (some pop ups have the full browser toolbar), this is why I interpreted pop up = new window – susan Nov 21 '16 at 9:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.