SharePoint 2010/SharePoint 2013 Custom Action: 基于Site Collection 滚动文字的通知.
应用场景: 有时候我们的站点需要在每个页面实现滚动文字的通知,怎么在不修改Master Page的情况下实现这个功能?我们可以使用Javascript 和 Custom Action 来实现。
- 创建一个Custom Action。主要使用到 Location = 'ScriptLink' 属性, 该属性可以动态的加载JavaScript 文件链接和代码块到模板页。代码如下:
<Elements xmlns="http://schemas.microsoft.com/sharepoint/"> <CustomAction Location="ScriptLink"
criptSrc="/_layouts/15/SP2013NotificationDemo/SiteNotification.js"
Sequence=""></CustomAction> <CustomAction Location="ScriptLink"
ScriptBlock="var windowOnload = window.onload || function(){}; window.onload = function(){ Notification_Demo(); };"
Sequence=""></CustomAction> </Elements>
- 创建一个JavaScript 文件,去添加一段Html代码实现滚动文字。这个JavaScript文件可以放在Layouts目录下面,也可以放在站点的Style Library中。在HTML中主要使用到Marquee标签的一些属性。
function Notification_Demo() {
var elemForm = document.getElementsByTagName("form")[];
var elemDiv = document.createElement("div");
elemDiv.innerHTML = "<marquee scrollamount='4' style='color:yellow;' onmouseover=this.stop() onmouseout=this.start()>This is a Marquee test!!!</marquee>";
elemDiv.style.cssText = "background:red;width:100%;font-size:20px;";
document.body.insertBefore(elemDiv, elemForm);
}
- 代码结构图如下:
Feature Scope 设置成了Site. 如果需要把这个滚动通知应用到一个web application下面的多个site collection中,可以把Feture scope 设置成Web Application.

SharePoint 2010/SharePoint 2013 Custom Action: 基于Site Collection 滚动文字的通知.的更多相关文章
- SharePoint 2013 How to Backup Site Collection Automatically With a PowerShell Script
In this post I will introduce a way how to run a script for backing up SharePoint data which could b ...
- [SharePoint 2010] SharePoint 2010 部署、收回和删除解决方案----STSADM和PowerShell
STSADM stsadm -o addsolution –filename c:\bin\CustomerSiteSearch.wsp stsadm -o deploysolution –name ...
- SharePoint 2010、2013多个域之间互信(Domain Trust)的设计与实施
在现实的业务场景中,有时为了更好的管理域用户和服务.我们往往会创建多个分散式的域,每个域的Administrator专注于维护特定域中的用户和资源,Administrator也可以定义安全策略,比如账 ...
- [SharePoint 2010] SharePoint 2010上多人同時編輯Office 2010文件
Office 2010這個版本,提供了一個令人興奮的新功能,那就是它可以讓多人同時編輯一份Office 2010的文件. 這是一個很大的突破. 以往在與SharePoint搭配下的分享環境,檔案只能被 ...
- [SharePoint 2010] SharePoint 2010 FBA 配置以及自定义首页
https://blogs.msdn.microsoft.com/kaevans/2010/07/09/sql-server-provider-for-claims-based-authenticat ...
- SharePoint 2010 将带有工作流的模板移动到另一个站点集
HOWTO Move or Migrate SharePoint 2010 List-based Workflows between Sites and Site Collections I’ve e ...
- [SharePoint 2010] 自定义字段类型开发(二)
在SharePoint 2010中实现View Action Button效果. http://www.sharepointblogs.be/blogs/vandest/archive/2008/06 ...
- sharepoint 2010 列表数据分页控件介绍 pagination UserControl
转:http://blog.csdn.net/chenxinxian/article/details/8714391 这里主要是介绍下最近开发的一个sharepoint列表或者文档库的分页控件,并且把 ...
- SharePoint 2010 Form Authentication (SQL) based on existing database
SharePoint 2010 表单认证,基于现有数据库的用户信息表 本文主要描写叙述本人配置过程中涉及到的步骤,仅作为參考,不要仅限于此步骤. 另外本文通俗易懂,适合大众口味儿. I. 开启并配置基 ...
随机推荐
- GSS3 SPOJ 1716. Can you answer these queries III gss1的变形
gss2调了一下午,至今还在wa... 我的做法是:对于询问按右区间排序,利用splay记录最右的位置.对于重复出现的,在splay中删掉之前出现的位置所在的节点,然后在splay中插入新的节点.对于 ...
- JQuery multiselect的相关使用
这两天做项目需要用到多选控件,于是选择了JQuery multiselect控件,介绍一下常用的一些相关属性. 详细地址:http://davidstutz.github.io/bootstrap- ...
- Page.ClientScript.RegisterStartupScript
Page.ClientScript.RegisterStartupScript方法最初可用的选项之一就是使用一个可实现此功能的 .NET 类来注册脚本块. 第一个是 RegisterStartupSc ...
- 发现个div float的小秘密
浮动时宽度塌缩了不再是父元素100%.
- SharedPreferences保存用户登录信息
UI界面:
- Part 6 Group by in sql server
- Windows删除大文件
Temp是目录 或者是 文件很大很大很大很大 cmd rd /s /q Temp
- Cocos2d-JS中瓦片地图API
为了访问瓦片地图,Cocos2d-JS中访问瓦片地图API,主要的类有:TMXTiledMap.TMXLayer和TMXObjectGroup等.1.TMXTiledMapTMXTiledMap是瓦片 ...
- C++ Priority Queues(优先队列) and C++ Queues(队列)
C++优先队列类似队列, 但是在这个数据结构中的元素按照一定的断言排列有序. empty() 如果优先队列为空,则返回真 pop() 删除第一个元素 push() 加入一个元素 size() 返回优先 ...
- [NOIP2014]解方程
3732 解方程 时间限制: 1 s 空间限制: 128000 KB 题目等级 : 钻石 Diamond 题解 题目描述 Description 输入描述 Input Descrip ...