【问题标题】:Joomla Variable Span gridJoomla 可变跨度网格
【发布时间】:2014-03-05 02:51:58
【问题描述】:

我的 joomla 3.1 带有引导程序的模板有一些问题。 我不知道 php 变量或其他东西。问题是如果我在正确的位置打开某个 span3 模块,如何将 Content span12 更改为 span 9?

[-------------内容跨度12------------] [-----content span9-------][module span3]

我发现了这个: Basic php to set column width in Joomla 但我不明白。有人可以帮我做什么吗?谢谢。

【问题讨论】:

  • 不确定你的问题是什么......如果你“打开”一个模块在正确的位置,它在哪里显示,它是否会出现任何布局问题?

标签: php twitter-bootstrap joomla


【解决方案1】:

在模板顶部添加:

<?php
$main_width = 12;
if ($this->countModules('right'))
  $main_width = 9;
?>

然后你输出内容的地方修改:

<div class="main-content span<?php echo $main_width; ?>">--Content--</div>
<?php if ($this->countModules('right') : ?>
  <div class="right-module span3">--Right modules output--</div>
<?php endif; ?>

【讨论】:

  • 我发现了一些有用的东西: if($this->countModules('left and right') == 0) $contentwidth = "12"; if($this->countModules('left or right') == 1) $contentwidth = "8";
  • 嗯,它和我的代码完全一样,只是添加了左边的位置。 :)
猜你喜欢
  • 1970-01-01
  • 2016-08-24
  • 2016-10-27
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多