Deploy custom Css,Js files in SharePoint 2010 using visual studio 2010

2024-04-22 09:38

本文主要是介绍Deploy custom Css,Js files in SharePoint 2010 using visual studio 2010,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

Deploy custom Css,Js files in SharePoint 2010 using visual studio 2010

In this post you learn how to deploy files like Css, js or images in Sharepoint 2010′s “Style library” using a solution package created in Visual studio 2010.
For deploying files to “STYLES” folder in 14 hive or “_layouts/1033/Styles” please see the post Add custom css file to styles folder in _layouts Sharepoint 2010

Steps to add Css file in “Style library” available in your SharePoint 2010 site -

1. Create an ‘Empty SharePoint project” in visual studio 2010 and name it “DeployFiles”. See the screen below.

Next, enter the url of your SharePoint site and select deploy as ‘Farm solution”.

2. Next, right click on the project and click Add -> New Item… then from the “Add new” item wizard select “Module” in SharePoint tab. Give it a name “CustomCssmodule”

3. Once you create the module you will get and “Elements.xml” and “Sample.txt” files create under it. For this example we will delete the Sample.txt file and will add our . I have used “Text File” from General tab to add my new Custom.css file. See the screen below. You can also add an existing CSS, XSL or Js file in the module.

4. After, adding the module and the css file your project should look like below.

5. Once your done adding your files you now need to modify your “Elements.xml” to specify the URL\ Path where the files will be deployed. To deploy the files into the “Styles Library” we will specify URL=”Style library” or if you want to deploy files into ‘MasterPage Gallery”  use URl=”_catalogs/masterpage. You typically do that when your deploying custom master or layout page.
Modified elements.xml

Don’t forget to add Type=”GhostableInLibrary” in your File tag.

6. Next, you make sure your feature includes your module so just open the feature1.feature and check that all the files are included in the module in the right side of your feature. Here you can also set the feature “Scope” to “Site,Web,Farm or web application”. I have set to to “Site”.

7. Now, all we have to do is “Build solution f6″ and then “Deploy”( Right click project properties).

8. Now navigate to “Style Library” in Site Actions -> View All Site Content -> Style Library and verify that your file Custom.css is deployed.

 

More to link: http://www.learningsharepoint.com/2011/05/15/deploy-custom-cssjs-files-in-sharepoint-2010-using-visual-studio-2010/

这篇关于Deploy custom Css,Js files in SharePoint 2010 using visual studio 2010的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/925435

相关文章

Vue ElementUI中Upload组件批量上传的实现代码

《VueElementUI中Upload组件批量上传的实现代码》ElementUI中Upload组件批量上传通过获取upload组件的DOM、文件、上传地址和数据,封装uploadFiles方法,使... ElementUI中Upload组件如何批量上传首先就是upload组件 <el-upl

前端知识点之Javascript选择输入框confirm用法

《前端知识点之Javascript选择输入框confirm用法》:本文主要介绍JavaScript中的confirm方法的基本用法、功能特点、注意事项及常见用途,文中通过代码介绍的非常详细,对大家... 目录1. 基本用法2. 功能特点①阻塞行为:confirm 对话框会阻塞脚本的执行,直到用户作出选择。②

Node.js net模块的使用示例

《Node.jsnet模块的使用示例》本文主要介绍了Node.jsnet模块的使用示例,net模块支持TCP通信,处理TCP连接和数据传输,具有一定的参考价值,感兴趣的可以了解一下... 目录简介引入 net 模块核心概念TCP (传输控制协议)Socket服务器TCP 服务器创建基本服务器服务器配置选项服

mac安装nvm(node.js)多版本管理实践步骤

《mac安装nvm(node.js)多版本管理实践步骤》:本文主要介绍mac安装nvm(node.js)多版本管理的相关资料,NVM是一个用于管理多个Node.js版本的命令行工具,它允许开发者在... 目录NVM功能简介MAC安装实践一、下载nvm二、安装nvm三、安装node.js总结NVM功能简介N

如何使用CSS3实现波浪式图片墙

《如何使用CSS3实现波浪式图片墙》:本文主要介绍了如何使用CSS3的transform属性和动画技巧实现波浪式图片墙,通过设置图片的垂直偏移量,并使用动画使其周期性地改变位置,可以创建出动态且具有波浪效果的图片墙,同时,还强调了响应式设计的重要性,以确保图片墙在不同设备上都能良好显示,详细内容请阅读本文,希望能对你有所帮助...

CSS3 最强二维布局系统之Grid 网格布局

《CSS3最强二维布局系统之Grid网格布局》CS3的Grid网格布局是目前最强的二维布局系统,可以同时对列和行进行处理,将网页划分成一个个网格,可以任意组合不同的网格,做出各种各样的布局,本文介... 深入学习 css3 目前最强大的布局系统 Grid 网格布局Grid 网格布局的基本认识Grid 网

HTML5中下拉框<select>标签的属性和样式详解

《HTML5中下拉框<select>标签的属性和样式详解》在HTML5中,下拉框(select标签)作为表单的重要组成部分,为用户提供了一个从预定义选项中选择值的方式,本文将深入探讨select标签的... 在html5中,下拉框(<select>标签)作为表单的重要组成部分,为用户提供了一个从预定义选项中

前端 CSS 动态设置样式::class、:style 等技巧(推荐)

《前端CSS动态设置样式::class、:style等技巧(推荐)》:本文主要介绍了Vue.js中动态绑定类名和内联样式的两种方法:对象语法和数组语法,通过对象语法,可以根据条件动态切换类名或样式;通过数组语法,可以同时绑定多个类名或样式,此外,还可以结合计算属性来生成复杂的类名或样式对象,详细内容请阅读本文,希望能对你有所帮助...

禁止HTML页面滚动的操作方法

《禁止HTML页面滚动的操作方法》:本文主要介绍了三种禁止HTML页面滚动的方法:通过CSS的overflow属性、使用JavaScript的滚动事件监听器以及使用CSS的position:fixed属性,每种方法都有其适用场景和优缺点,详细内容请阅读本文,希望能对你有所帮助... 在前端开发中,禁止htm

Vue3中的动态组件详解

《Vue3中的动态组件详解》本文介绍了Vue3中的动态组件,通过`component:is=动态组件名或组件对象/component`来实现根据条件动态渲染不同的组件,此外,还提到了使用`markRa... 目录vue3动态组件动态组件的基本使用第一种写法第二种写法性能优化解决方法总结Vue3动态组件动态