我正在将网站模板更改为drupal主题。
我将标题放在html.tpl.php
中,正文放在page.tpl.php
中,并设置.info
文件,但页面无法正确加载,并且网站图片未显示在浏览器中。
在我看来,这些设置和我仍然没有改变静态内容。它应该像静态版本一样工作,如果是这样的话会出现什么问题呢?
HTML code:
<html class="no-js" lang="en">
<head>
<meta charset="utf-8">
<title>Home</title>
<link rel="stylesheet" href="../css/style.css">
<script type="text/javascript" src="../js/modernizr.js"></script>
</head>
<body>
<div id="wrapper">
<div class="header-wrapper header-alt2">
<div class="works-thumb">
<img src="../img/works/works-8.jpg" alt="Project Name">
<div class="works-title">
<h4>
<a href="single-project-image.html">Project Name</a>
</h4>
</div>
<a href="portfolio.html" title="Category Name" class="works-icon"><i class="icon-play"></i></a>
<div class="overlay">
<h4></h4>
<p>Project Name Description</p>
<div class="overlay-icons">
<a href="../img/works/works-full8.jpg" title="Preview" class="works-preview fancybox tooltips"><i class="icon-eye"></i></a>
<a href="project-image.html" title="Permalink" class="works-link tooltips"><i class="icon-link"></i></a>
<a href="portfolio.html" title="Category Name" class="works-cat tooltips"><i class="icon-play"></i></a>
</div>
</div>
</div>
</div>
</div>
</body>
</html>
.info
档案:
包裹,核心和..
stylesheets[all][] = css/style.css
scripts[] = js/modernizr.js
和区域
html.tpl.php
档案:
?><!DOCTYPE html>
<html class="no-js" lang="en">
<head profile="<?php print $grddl_profile; ?>">
<?php print $head; ?>
<title><?php print $head_title; ?></title>
<?php print $styles; ?>
<?php print $scripts; ?>
</head>
<body class="<?php print $classes; ?>" <?php print $attributes;?>>
<?php print $page_top; ?>
<?php print $page; ?>
<?php print $page_bottom; ?>
</body>
</html>
page.tpl.php
档案:
<div id="wrapper">
<div class="header-wrapper header-alt2">
<div class="works-thumb">
<img src="../img/works/works-8.jpg" alt="Project Name">
<div class="works-title">
<h4>
<a href="single-project-image.html">Project Name</a>
</h4>
</div>
<a href="portfolio.html" title="Category Name" class="works-icon"><i class="icon-play"></i></a>
<div class="overlay">
<h4></h4>
<p>Project Name Description</p>
<div class="overlay-icons">
<a href="../img/works/works-full8.jpg" title="Preview" class="works-preview fancybox tooltips"><i class="icon-eye"></i></a>
<a href="project-image.html" title="Permalink" class="works-link tooltips"><i class="icon-link"></i></a>
<a href="portfolio.html" title="Category Name" class="works-cat tooltips"><i class="icon-play"></i></a>
</div>
</div>
</div>
</div>
</div>
答案 0 :(得分:1)
将所有图像复制到
/位点/所有/主题/ yourthemename /图像
文件夹。
然后更改page.tpl.php中的图像路径,如下所示:
/sites/all/themes/yourthemename/works-8.jpg
而不是使用:
../ IMG /作品/工作-8.JPG