سؤال

I am trying to link CSS file in my velocity file but for some reason is not working properly. Any ideas?

CSS filename:custom.css velocity file snip code:

<html class="#language("lang.dir")" dir="#language("lang.dir")" lang="$w3c_language_id">
<head>
<title>GreenZap</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<link href="/greenTheme-theme/docroot/css/custom.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="js/cufon-yui.js"></script>
<script type="text/javascript" src="js/arial.js"></script>
<script type="text/javascript" src="js/cuf_run.js"></script>
</head>

On the other hand I get the words "javascript" and "href" underlined with error line. Nut later on int he code "href" is not underlined anymore.

Any help will be appreciated!

Thanks in advance!

EDIT: I am using liferay 6.1 with Tomcat 7 and Liferay SDK for Eclipse. I am trying to integrate a website template to a liferay theme created with the SDK.

هل كانت مفيدة؟

المحلول

You need not have to link the css file to velocity.

Just follow these steps -

Im assuming that you have created theme and inside it you have copied the images,js,templates folder inside themes _diff folder .

Now inside your _diff/css/main.css

just copy these lines of code - @import url(custom.css);

HTH

نصائح أخرى

Try without the docroot in the path:

<link href="/greenTheme-theme/css/custom.css" rel="stylesheet" type="text/css" />

you can use another way. Create file common.vm with content:

.error-message {
    color: red;
}

In file container.vm, use:

#include("common.vm")

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top