Joomla 3 Article Options - How to get article view different from category blog view

筅森魡賤 提交于 2019-12-25 06:34:26

问题


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.

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.

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


回答1:


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.

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

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.

regards Jonas



来源:https://stackoverflow.com/questions/23006946/joomla-3-article-options-how-to-get-article-view-different-from-category-blog

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!