0

我正在处理 Concrete5 中的页面类型,该页面类型具有使用图像作为背景的全角部分。是页面应该看起来的样子,这里是 C5 中的。我使用了这个 C5 论坛帖子中描述的技术,但没有任何运气。我认为这个问题可能与对图像文件的引用有关。我不明白该属性如何与实际图像文件相关联。这是我的代码中包含的代码:

?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>

任何帮助深表感谢!

4

2 回答 2

0

几个月前,我写了一篇关于在页面上设置背景图像的方法。它通过屏幕截图解释了如何创建属性以及如何在页面上使用该属性。看看这里: http: //www.concrete5.org/documentation/how-tos/designers/use-attributes-to-set-background-images/

编辑:刚刚注意到我的回复有点晚了,但信息仍然有效。

于 2013-12-02T16:08:58.913 回答
0

您不会将该代码与服务器上的图像文件一起使用——而是将图像上传到文件管理器并从那里选择它。见http://www.concrete5.org/community/forums/themes/customising-theme-background-images/#190906

于 2013-07-18T00:08:10.747 回答