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

 

  1. 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的更多相关文章

  1. 修改Git远程地址 git config remote.origin.url "https://..."

    仓库管理: 添加或指定远程仓库地址 git remote set-url origin "https://..." git config remote.origin.url &qu ...

  2. Spring MVC 的 Java Config ( 非 XML ) 配置方式

    索引: 开源Spring解决方案--lm.solution 参看代码 GitHub: solution/pom.xml web/pom.xml web.xml WebInitializer.java ...

  3. ASP.NET 自定义URL重写 分类: ASP.NET 2014-10-31 16:05 175人阅读 评论(0) 收藏

    一.功能说明: 可以解决类似 http://****/news 情形,Url路径支持正则匹配. 二.操作步骤: 1.增加URL重写模块: using System; using System.IO; ...

  4. ASP.NET 自定义URL重写 分类: ASP.NET 2014-10-31 16:05 174人阅读 评论(0) 收藏

    一.功能说明: 可以解决类似 http://****/news 情形,Url路径支持正则匹配. 二.操作步骤: 1.增加URL重写模块: using System; using System.IO; ...

  5. thinkphp隐藏中url的index.php

    在本地进行测试 1.修改apache配置文件将如下代码#去掉 #LoadModule rewrite_module modules/mod_rewrite.so   在index.php 目录下新建文 ...

  6. git config(转载)

    From:http://www.g2w.me/2013/10/cache-github-credential-for-https-repository/ http://openwares.net/li ...

  7. URL重写案例

    实现url重写的基本方法:  将下载的URLRewriter.dll,放到你的web程序的bin下 然后在web.config里配置如下: <?xml version="1.0&quo ...

  8. 对 Sea.js 进行配置(一) seajs.config

    可以对 Sea.js 进行配置,让模块编写.开发调试更方便. seajs.config seajs.config(options) 用来进行配置的方法. seajs.config({ // 别名配置 ...

  9. 使用自定义 URL 实现控制器之间的跳转-b

    一个app往往有很多界面,而界面之间的跳转也就是对应控制器的跳转,控制器的跳转一般有两种情况 push 或者 modal,push 和 modal 的默认效果是系统提供的 文章配图 1. 概述 系统提 ...

随机推荐

  1. C++ c++与C语言的区别(实用性增强,register关键字增强,全局变量检测增强)

    //区别①:实用性增强 #include<iostream> using namespace std; //C语言中的变量都必须在作用域开始的位置定义!! //C++中更强调语言的“实用性 ...

  2. 通过jdbc获取数据库中的表结构

    通过jdbc获取数据库中的表结构 主键 各个表字段类型及应用生成实体类   1.JDBC中通过MetaData来获取具体的表的相关信息.可以查询数据库中的有哪些表,表有哪些字段,字段的属性等等.Met ...

  3. Linux 下,mysql数据库报无法登陆错误:ERROR 1045 (28000): Access denied for use

    今天在别人的服务器上登录mysql发现无法登陆(Mysql别人实现安装好的) 密码和用户名都是正确的,但登录后报如下错误: ERROR 1045 (28000): Access denied for ...

  4. iOS如何上传代码到Github

    iOS如何上传代码到Github 很多iOS开发者想开源自己的代码或者demo,开源到Github是个不错的选择,那么如何上传我们的代码到Github,令所有人可以下载使用呢?这里我们的目的很明确,就 ...

  5. Ubuntu驱动摄像头

    之前研究Opencv的时候是安装了一个virtualbox的虚拟机,然后发现电脑自带的摄像头无法被识别. 后来买了一个罗技的C270,仍然无法识别,而且插入到虚拟机之后会导致虚拟机死机,原因未知. - ...

  6. 几种Boost算法的比较(Discrete AdaBoost, Real AdaBoost, LogitBoost, Gentle Adaboost)

    关于boost算法 boost算法是基于PAC学习理论(probably approximately correct)而建立的一套集成学习算法(ensemble learning).其根本思想在于通过 ...

  7. Object C学习笔记23-继承,重写,重载

    前面的学习都一直在使用Object C对象,但是没有具体总结过Object C中的对象使用特性,这里简单总结一下. 一.  继承 在面向对象编程中,子类可以通过继承得到父类的可以继承的的属性和方法,在 ...

  8. [1015][JSOI2008]星球大战starwar(并查集)

    1015: [JSOI2008]星球大战starwar Time Limit: 3 Sec  Memory Limit: 162 MBSubmit: 2124  Solved: 909[Submit] ...

  9. Coding the Matrix (1):向量

    1. list 画点 >>> from plotting import plot >>> L = [[2, 2], [3, 2], [1.75, 1], [2, 1 ...

  10. linux中的进程管理

    USER  那个用户启动的进程 PID     该进程的ID号 %CPU   占用的CPU百分比 %MEM   占用的物理内存百分比 VSZ      占用虚拟内存大小 KB RSS      占用实 ...