【问题标题】:Remove White Space in Virtuemart 'Featured Products' Module删除 Virtuemart“特色产品”模块中的空白
【发布时间】:2011-12-20 19:14:48
【问题描述】:

我在弄清楚如何摆脱空白时遇到了一些麻烦。我真的不知道自己做错了什么,而且我对 html 的了解还不够,无法知道这是否是问题所在。

附上截图:

1) 如果我保留代码原样,我的图像将与正下方的模块重叠。

2) 如果我修改代码使表格单元格高度为 400px,则会产生大量空白。

3) 如果我修改代码以使表格单元格高度为 1-399 像素,则会产生过多的空白或重叠。

修改后的代码注意:我使用的是“水平”显示样式):

<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
    <span style="color:green"><b>> <b></span>Click here to <a href="http://localhost/joomlawebsite/index.php?option=com_content&view=article&id=52"><span style="color:blue"><b>view all featured products</b></span></a>.
</tr>
<?php
$i = 0;
while($db->next_record() ){
    if ($i%2)
    $sectioncolor = "sectiontableentry2";
    else
    $sectioncolor = "sectiontableentry1";

    if( $display_style == "vertical" ) {
    ?>
        <tr align="center" class="<?php echo $sectioncolor ?>">
            <td width="<?php echo $width ?>%">
                <?php 
                $ps_product->show_snapshot($db->f("product_sku"), $show_price, $show_addtocart);
                ?><br />
            </td>
        </tr>
    <?php
    }
    elseif( $display_style== "horizontal" ) {
        if( $i == 0 )
        echo "<tr>\n";
        echo "<td height=\"400px\" width=\"$width%\" align=\"center\">";
        $ps_product->show_snapshot($db->f("product_sku"), $show_price, $show_addtocart);
        echo "</td>\n";
        if( ($i+1) == $db->num_rows() )
        echo "</tr>\n";
    }
    elseif( $display_style== "table" ) {
        if( $i == 0 )
        echo "<tr>\n";
        echo "<td width=\"$width%\" align=\"center\">";
        $ps_product->show_snapshot($db->f("product_sku"), $show_price, $show_addtocart);
        echo "</td>\n";
        if ( ($i+1) % $products_per_row == 0)
        echo "</tr><tr>\n";
        if( ($i+1) == $max_items )
        echo "</tr>\n";
    }
    $i++;
}?></table>

任何帮助将不胜感激。

【问题讨论】:

  • 看来其他人也有同样的问题。我仍然不知道解决方案,但一个共同点似乎是 Virtuemart 版本 1.1.9 稳定。有任何想法吗? Link to Virtuemart Forum

标签: html joomla joomla1.5 virtuemart joomla-module


【解决方案1】:

更改在 components/com_virtuemart/themes/"yourtemplate"/templates/common/productsnapshot.tpl.php

&lt;!-- The product name DIV. --&gt;
我把 div 样式代码改成这样:

<div style="height:35px; float:left; width: 100%;line-height:14px;">



&lt;!-- The product image DIV. --&gt;
我把 div 样式代码改成这样:

<div style="width: 100%;float:left">


它消除了所有不必要的空白

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-12-14
    • 1970-01-01
    相关资源
    最近更新 更多