自定义joomla模板(类别、单项等)

发布于 2024-10-04 00:57:30 字数 195 浏览 1 评论 0原文

可以为不同类型的内容自定义模板...例如,在主页上:1 列,在类别列表上:2 列,在单篇文章上:3 列。在Wordpress 中这非常简单,修改home.php、category.php、single.php。

有什么条件我可以在 Joomla 1.5 中完成此操作?

谢谢

It's possible to customize the template for different types of content... for example, on homepage: 1 column, on category listing: 2 columns, on single article: 3 columns. In Wordpress it's quite easy, modifying home.php, category.php, single.php.

With what conditionals I can accomplish this in Joomla 1.5?

Thanks

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

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

发布评论

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

评论(2

各自安好 2024-10-11 00:57:30

您可以有条件地逐页显示模块(基于菜单项)。您还可以为每个页面分配完全不同的模板。此外,您可以在 index.php 中执行类似操作

$option = JRequest::getCmd('option');
$view = JRequest::getCmd('view');

并根据视图/组件更改页面。

Joomla 的模板非常出色,具有很大的灵活性。

You can conditionally display modules on a page by page basis (based on menu item). You can also assign completely different templates to each page. Furthermore, you can do things like

$option = JRequest::getCmd('option');
$view = JRequest::getCmd('view');

within your index.php and change the page based on the view/component.

Joomla's templating is excellent, with a lot of flexibility.

甜嗑 2024-10-11 00:57:30

如果只有一列包含真实内容(组件/文章),您也可以使用可折叠模块位置。像这样:

<?php if($this->countModules('left')) : ?>
    <div class="left_column">
        <jdoc:include type="modules" name="left" style="xhtml" />
    </div>
<?php endif; ?></code></pre>

那么这个栏目中模块的存在与否将决定布局。

If only one column contains the real content (componenent/article) you could also work with collapsible module positions. Like this:

<?php if($this->countModules('left')) : ?>
    <div class="left_column">
        <jdoc:include type="modules" name="left" style="xhtml" />
    </div>
<?php endif; ?></code></pre>

Then the presence or absence of modules in this column will determine the layout.

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