在SharePoint 2013中以“页面编辑"模式将AssetPortalBrowser中的文件/图像插入页面 [英] Insert a File/image from AssetPortalBrowser onto the page in Page edit mode in SharePoint 2013

查看:87
本文介绍了在SharePoint 2013中以“页面编辑"模式将AssetPortalBrowser中的文件/图像插入页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

默认插入图片".操作可以在网站页面编辑模式下进行.我正在寻找自定义上传文件"采取某种行动,例如图片"行动.即点击上传文件" 操作它应该打开一个模式对话框,例如AssetPortalBrowser.aspx(

The default insert "Picture" action is available as it is in a  site page edit mode. I'm looking for customizing the "Upload File" action to work some what like "Picture" action. i.e,  on click on "Upload File" action it should open up a modal dialog like the AssetPortalBrowser.aspx(.../_layouts/15/AssetPortalBrowser.aspx) and hence i can select the file and then on click on "insert" button a link to the file needs to be inserted on the page.

我能够显示模式对话框并打开AssetPortalBrowser.aspx页面,但是很遗憾,我无法以页面编辑模式将所选文件的链接插入页面上."

I am able to show up the modal dialog and open the AssetPortalBrowser.aspx page, but unfortunately i am not able to "Insert the link of the selected file onto the page in page edit mode.

这是我用于在单击链接时使用资产门户浏览器打开模式对话框的脚本(我已将其合并到自定义功能区操作中):

Here is the script i'am using in for opening the modal dialog with the asset portal browser on click of a link(which i had incorporated in to the custom ribbon action):

<script>
function openDialog(pageUrl) {
var options = {
url: pageUrl,
title: 'Select an Asset',
allowMaximize: false,
showClose: true,

};
SP.SOD.execute('sp.ui.dialog.js', 'SP.UI.ModalDialog.showModalDialog', options);
}
</script>
<a href="#" onclick="openDialog('<site>/_layouts/15/AssetPortalBrowser.aspx');">Upload File</a>





推荐答案

如果要在页面编辑模式下从AssetPortalBrowser.aspx插入文件链接,我们可以直接使用OOTB功能区操作链接"->来自SharePoint":

If you want to insert the file links from AssetPortalBrowser.aspx in Page Edit Mode, we can directly use the OOTB ribbon action "Links"->"From SharePoint":

它将弹出AssetPortalBrowser模型对话框,然后选择一个文件并单击插入",该文件链接将插入到页面:

It will pop up the AssetPortalBrowser model dialogue, then select a file and click insert, the file link will be inserted to the page:

谢谢

最好的问候


这篇关于在SharePoint 2013中以“页面编辑"模式将AssetPortalBrowser中的文件/图像插入页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆