Joomla 3 文章选项 - 如何使文章视图不同于类别博客视图 [英] Joomla 3 Article Options - How to get article view different from category blog view

查看:20
本文介绍了Joomla 3 文章选项 - 如何使文章视图不同于类别博客视图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用默认模板全新安装了 Joomla 3.2.3 并使用它进行测试.这是我目前的设置方式:

I have a clean install of Joomla 3.2.3 using the default template and testing with it. Here is how I have it set up at the moment:

    Main Menu with Article >> Category Blog
    Main Article category
    4 Test articles linked to the Main Article category

我想在类别博客视图中隐藏文章作者(文章选项),但是当我点击阅读全文时,我希望显示文章作者.

I would like to hide the article author (article options) in the category blog view, but when I click to read the full article I would like to have the article author displayed.

当我在类别博客设置中隐藏作者时,它也会在全文视图中隐藏作者.我可以为每篇文章覆盖它,但这非常烦人,如果我忘记了,可能会错过.从我从谷歌搜索中了解到,这是 Joomla 传播这些设置的方式(全局 -> 菜单 -> 文章).我可能错了.

When I hide the author in the category blog settings, it also hides the author in the full article view. I can an override this for each article, but this is extremely annoying and might be missed if I forget. From what I understand from googling this is how Joomla propagates these settings (Global -> Menu -> Article). I might be wrong.

有没有办法解决这个问题?自定义文章视图?IMO 这是来自 Joomla 的限制性设计模式,但他们可能有其原因.

Is there a way around this? Custom article view? IMO this is a restrictive design pattern from Joomla, but they might have their reasons.

推荐答案

我想设置的工作方式总是要权衡的,如果设置不遵循菜单设置可能会更烦人,但这就是你通缉.

I guess there are always tradeoffs to how settings work, It would be perhaps more annoying if the settings did not follow the menu-setting, but this is what you wanted.

解决方案是覆盖文章内容布局.有很多关于这个 om 的文章(例如这里)

The solution is to override the article content layout. There are a number of articles about this om (eg here)

基本上,您将文件 components/com_content/views/article/tmpl/default.php 复制到模板的 html/com_content/article 文件夹中,并为其指定一个新名称(例如 showauthor.php).您还必须以相同的方式覆盖类别博客视图.在那里您更改文章链接,使其包含 layout=showauthor.这应该使用 showauthor.php - 布局显示文章.

Basically you copy the file components/com_content/views/article/tmpl/default.php to the html/com_content/article - folder of your template, and give it a new name (eg. showauthor.php). You will also have to override the category blog view in the same way. There you change the article-link so it includes layout=showauthor. This should display the article using the showauthor.php - layout.

问候乔纳斯

这篇关于Joomla 3 文章选项 - 如何使文章视图不同于类别博客视图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆