我的Page.ss无法加载CSS和脚本SilverStripe v4.2.1

时间:2018-10-29 13:10:36

标签: html css silverstripe silverstripe-4

我将WAMP作为本地服务器。我仔细按照说明进行操作,无法在Page.ss上加载CSS和脚本。我刷新了缓存并刷新了页面并更新了hrefs,但它们似乎都没有起作用。

Page.ss

<html>
<head>
<title></title>
<meta charset = "UTF-8">
<meta name="description" content= "">
<meta name="author" content= "Lisandro">
<meta name="keywords" content= "">
<meta name="viewport" content="width=device-width" initial-scale="1">
<link rel="stylesheet" 
href="https://use.fontawesome.com/releases/v5.4.1/css/all.css">

<link href="https://fonts.googleapis.com/css?family=Noto+Sans" 
rel="stylesheet">
<link rel="stylesheet" type="text/css" href="themes/u-mart/css/slick.css">
<link rel="stylesheet" type="text/css" href="themes/u-mart/css/slick- 
theme.css">       
<link rel="stylesheet" type="text/css" href="themes/u-mart/css/style.css">
<link rel="stylesheet" 
 href="https://use.fontawesome.com/releases/v5.4.1/css/all.css">

<script src="https://code.jquery.com/jquery-3.3.1.js"></script>


</head>
<body>
"TONS OF HTML CODES"
</body>
</html>

This is where my page.ss is located

enter image description here

1 个答案:

答案 0 :(得分:1)

找到了答案。您所要做的就是将这些行添加到您的.SS文件中。

 <% require css("<my-module-dir>/css/some_file.css") %>
 <% require themedCSS("some_themed_file") %>
 <% require javascript("<my-module-dir>/javascript/some_file.js") %>

这些内容未在其网站上的课程中也未在视频中提及。您将不得不自己挖。