Joomla文章的砖块

问题描述 投票:0回答:1

我想以图片的形式显示一些带有标题和内文的文章。我使用了Articles-Newsflash模块,并创建了一个名为blocks.php的自定义布局。

<div class="newsflash-block<?php echo $params->get('moduleclass_sfx'); ?> mod-list">
<?php for ($i = 0, $n = count($list); $i < $n; $i ++) : ?>
    <?php $item = $list[$i]; ?>
    <div class="tile col-lg-6 col-md-6">
        <?php require JModuleHelper::getLayoutPath('mod_articles_news', '_block-item'); ?>

        <?php if ($n > 1 && (($i < $n - 1) || $params->get('showLastSeparator'))) : ?>
            <span class="article-separator">&#160;</span>
        <?php endif; ?>
    </div>
<?php endfor; ?>

我也创建了一个名为_block-item.php的子布局,用于显示文章元素

<div class="block-item">
<a href="<?php echo $item->link; ?>">

    <figure class="newsflash-image">
    <img src="<?php echo $item->imageSrc; ?>" alt="<?php echo $item->imageAlt; ?>">

    <?php if ($params->get('show_introtext', 1)) : ?>
        <span class="text"><?php echo $item->introtext; ?></span>
    <?php endif; ?>
    <span class="title"><?php echo $item->title; ?></span>
    </figure>

</a>

问题出在html-css端,因为我无法在图像上而不是下方获得标题或文本显示。我很确定我没有正确使用元素。

我希望我的积木看起来像这样:enter image description here

代替此:enter image description here

因此,文章的简介应该是特定图块的背景,并且在div中,我应该具有简介文字和标题。

我想以图片的形式显示一些带有标题和内文的文章。我使用了Articles-Newsflash模块,并创建了一个自定义布局,称为blocks.php

html css joomla
1个回答
0
投票

更改为称为_block-item.php的子布局。

© www.soinside.com 2019 - 2024. All rights reserved.