具体5背景图像未显示



我正在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>

非常感谢您的帮助!

您不将该代码用于服务器上的图像文件,而是将图像上传到文件管理器并从中选择。看见http://www.concrete5.org/community/forums/themes/customising-theme-background-images/#190906

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

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

最新更新