Joomla 3文章选项-如何使文章视图不同于类别博客视图 [英] Joomla 3 Article Options - How to get article view different from category blog view
问题描述
我使用默认模板全新安装了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)
基本上,您将文件component/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屋!