Config The Image URL Solution
During the project, in order to make a unified management for the image URL , at present we make use of the LESSCSS method, set the image URL as independent variable, then all images use the image URL variable, it’s convenient for future maintenance. To make sure the LESS CSS work normal, we need to make some configuration for web.config , please refer to the http://www.dotlesscss.org/, the steps as follows:
Configure web.config
1. Download the latest dotless package
You can find the latest source & downloads for dotless at GitHub, extract file ,then you can get file named “dotless.Core.dll”
2. Include our reference to your web project
Add the dotless.Core.dll file to our references file
3. Add a new HttpHandler to your Web.Config
Let’s make the dotless processor handle our .LESS files.Add this entry to the HttpHandlers section of your Web.Config:
<add name="LessCssHttpHandler" verb="*" path="*.LESS" preCondition="integratedMode" type="dotless.Core.LessCssHttpHandler,dotless.Core"/>
4. Add a few configuration sections (optional)
First add our config handler in the "configSections" node of your web.config
<section name="dotless" type="dotless.Core.configuration.DotlessConfigurationSectionHandler,dotless.Core" />
Now you can configure caching and minifying of the Css output
<dotless minifyCss="true" cache="true" />
Note: when we work on the project , we need to use <dotless minifyCss="false" cache="false" /> on our web.config, because when we make some change for any file, we need to see the change at once without cache. of course, when project finish and release , we need to use <dotless minifyCss="true" cache="true" />
5. Get started
Reference your LESS files the same way as you would any other CSS file, just ensure that you use the .LESS extention.
Modify the image URL for project
- Take our project file as example, Find the image url less file named
truck\WebCenter\CommonModule\UI\CSS\imgurlConfig.less, you will see the image url variables on the top of page
@base-url-secure: "https://secure.officescape.com/shared/images";
@base-url-web: "/WebCenter/CommonModule/UI/images/";
You only need to modify the image url value of variables named @base-url-secure and @base-url-web when you want to change all images url address on project.
Config The Image URL Solution的更多相关文章
- 修改Git远程地址 git config remote.origin.url "https://..."
仓库管理: 添加或指定远程仓库地址 git remote set-url origin "https://..." git config remote.origin.url &qu ...
- Spring MVC 的 Java Config ( 非 XML ) 配置方式
索引: 开源Spring解决方案--lm.solution 参看代码 GitHub: solution/pom.xml web/pom.xml web.xml WebInitializer.java ...
- ASP.NET 自定义URL重写 分类: ASP.NET 2014-10-31 16:05 175人阅读 评论(0) 收藏
一.功能说明: 可以解决类似 http://****/news 情形,Url路径支持正则匹配. 二.操作步骤: 1.增加URL重写模块: using System; using System.IO; ...
- ASP.NET 自定义URL重写 分类: ASP.NET 2014-10-31 16:05 174人阅读 评论(0) 收藏
一.功能说明: 可以解决类似 http://****/news 情形,Url路径支持正则匹配. 二.操作步骤: 1.增加URL重写模块: using System; using System.IO; ...
- thinkphp隐藏中url的index.php
在本地进行测试 1.修改apache配置文件将如下代码#去掉 #LoadModule rewrite_module modules/mod_rewrite.so 在index.php 目录下新建文 ...
- git config(转载)
From:http://www.g2w.me/2013/10/cache-github-credential-for-https-repository/ http://openwares.net/li ...
- URL重写案例
实现url重写的基本方法: 将下载的URLRewriter.dll,放到你的web程序的bin下 然后在web.config里配置如下: <?xml version="1.0&quo ...
- 对 Sea.js 进行配置(一) seajs.config
可以对 Sea.js 进行配置,让模块编写.开发调试更方便. seajs.config seajs.config(options) 用来进行配置的方法. seajs.config({ // 别名配置 ...
- 使用自定义 URL 实现控制器之间的跳转-b
一个app往往有很多界面,而界面之间的跳转也就是对应控制器的跳转,控制器的跳转一般有两种情况 push 或者 modal,push 和 modal 的默认效果是系统提供的 文章配图 1. 概述 系统提 ...
随机推荐
- Socket Programming in C#--Introduction
This is the second part of the previous article about the socket programming. In the earlier article ...
- C语言 文件操作6--文件打开方式详解
fopen文件打开模式 r代表read的简写,+代表可读可写,w代表write,b代表bit二进制位,t代表text r 打开只读文件,该文件必须存在r+ 打开可读可写的文件,该文件必须存在(这里的写 ...
- 万向节死锁 gimbal lock
,如下图一,把灰色箭头想象成是一架飞机,红,绿蓝三个圈看作是三个外围控制器,外圈带动所有里圈运动,里圈的运动不影响外圈. 1,首先,绕Y轴旋转(旋转绿圈),来确定前进的方向.这时红圈与蓝圈都跟着旋转. ...
- php基础21:上传文件
<?php /* 通过使用 PHP 的全局数组 $_FILES,你可以从客户计算机向远程服务器上传文件 第一个参数是表单的 input name,第二个下标可以是 "name" ...
- echo "scale=100; a(1)*4" | bc -l 输出圆周率
突然看到echo "scale=100; a(1)*4" | bc -l可以输出圆周率,很惊奇,后来发现很简单. 首先bc是“basic calculator”的缩写,就是初级的计 ...
- 访问 IIS 元数据库失败 的解决方法
系统是windows xp sp3,vs2010.安装了iis 5.1 ,创建了虚拟目录之后copy进去一个web sercices测试下能不能正常工作. 出现如下问题: 访问 IIS 元数据库失败. ...
- 整合 Bing translator 到自己的系统中
整合这个功能, 是因为 aliexpress 的买家来自不同国家, 我的 "小卖家" 同步到买家的留言, 很多西班牙,俄罗斯等小语种的文字, 看不懂. Google 被墙, 基本很 ...
- JavaScript实例---表格隔行变色以及移入鼠标高亮
<!DOCTYPE HTML> <html> <head> <meta charset="utf-8"> <title> ...
- JS中decodeURI()与decodeURIComponent()区别
decodeURI()定义和用法:decodeURI() 函数可对 encodeURI() 函数编码过的URI 进行解码. 语法:decodeURI(URIstring) 参数 描述:URIstrin ...
- sql 随机函数newid()
newid()返回的是uniqueidentifier类型的唯一值.newid()每次产生的值都不一样 从表中随机获取前N条记录 select top N * from table_name ord ...