我正在处理Concrete5中的一种页面类型,它有一个使用图像作为背景的全宽部分。Here是页面的外观,here是C5中的页面。我使用了this C5 forum thread中描述的技术,但没有任何运气。我认为这个问题可能与对图像文件的引用有关。我不明白属性是如何与实际的图像文件相关联的。以下是my中包含的代码:
?php
$bg_img = $c->getAttribute('gymMatBackgroundImage');
$bg_img_src = $bg_img->getRelativePath();
?>
<style type="text/css">
.bar4 {
background-image: url(<?php echo $bg_img_src; ?>);
}
</style>
下面是需要背景图片的部分:
<div class="fullWidthBar bar4">
<div class="row">
<div class="large-12 columns">
<h3>Sign Up</h3>
<div style="width: 50%; height:300px; background-color:white; float:right;">Calendar Placeholder</div>
<p>Sign on for a three or six month commitment to recieve a discount</p>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p>
</div>
</div>
</div>
任何帮助都是非常感谢的!
发布于 2013-07-18 08:08:11
您不必将该代码用于服务器上的图像文件--而是将图像上传到文件管理器并从中选择它。请参阅http://www.concrete5.org/community/forums/themes/customising-theme-background-images/#190906
发布于 2013-12-03 00:08:59
几个月前,我写了一篇关于在页面上设置背景图片的操作指南。它用屏幕截图解释了如何创建属性以及如何在页面上使用属性。看看这里:http://www.concrete5.org/documentation/how-tos/designers/use-attributes-to-set-background-images/
编辑:我只是注意到我的回复有点晚了,但信息仍然有效。
https://stackoverflow.com/questions/17642165
复制相似问题