更改每个组件的模板布局

发布于 2024-12-21 01:38:11 字数 107 浏览 3 评论 0原文

我有 1 个模板,有两列。左侧宽度为 250 像素,右侧宽度为 700 像素。我希望在调用组件横幅时,Joomla 只显示一栏宽度为 950 像素。如何进行这项工作?谢谢。 我使用 joomla1.7

I have 1 template that has two columns.left with 250px width and right with 700px width.i want when component Banners called,Joomla only show one column with 950px width.how to this work?thanks.
I work with joomla1.7

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

開玄 2024-12-28 01:38:11

我有另一个解决方案给你。
让我们将您的位置称为左、主和横幅。这是你需要做的(或者我会如何做)。

首先,为了保持模板干净,请在模板的根文件夹中创建新文件 vars.php。
该文件包含:

$mainWidth = 950;
if ($this->countModules( 'left' )):
$mainWidth = $mainWidth - 250;
endif;

在模板的 index.php 文件中包含文件 vars.php:

 <?php require_once('vars.php'); ?>

将主容器 div 更改为:
px">

更改左侧容器输入:

<?php if ($this->countModules( 'left' )) : ?>
<div id="left"><jdoc:include type="modules" name="left" /></div>
<?php endif; ?>

现在只需关闭左侧位置的所有模块,用于横幅组件。:)

I have another solution for you.
Lets call your positions left, main and banner. Here's what you need to do (or how I would do it).

First, to keep your template clean, create new file vars.php in your template's root folder.
This file contains:

$mainWidth = 950;
if ($this->countModules( 'left' )):
$mainWidth = $mainWidth - 250;
endif;

Include file vars.php in your template's index.php file:

 <?php require_once('vars.php'); ?>

Change the main container div to:
px">

Change the left container input:

<?php if ($this->countModules( 'left' )) : ?>
<div id="left"><jdoc:include type="modules" name="left" /></div>
<?php endif; ?>

Now just simply turn off all modules in the left position, for banners component. :)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文