简体   繁体   English

覆盖joomla类别列表视图

[英]Override joomla category list view

I'm trying to change category title in joomla category list (list of all articles in a certain category) but I simply can't find the right file to override. 我正在尝试更改joomla类别列表(某个类别中所有文章的列表)中的类别标题,但我只是找不到正确的文件来覆盖。

Files are supposed to be in components\\com_content\\views\\category\\tmpl and there's default.php that renders wrapper with a class of .category-list and default_articles which is rendering table with list of article names in a selected category. 文件应该位于components\\com_content\\views\\category\\tmpl并且有default.php呈现具有.category-listdefault_articles类的包装器,该类呈现具有所选类别中物品名称列表的表格。

What I can't find is file which renders category title and description. 我找不到的是呈现类别标题和描述的文件。 Here's the content of default.php as it might be the key. 这是default.php的内容,因为它可能是关键。 I don't quite understand what files it's calling since I haven't been in joomla development for ages. 我不太了解它在调用什么文件,因为我已经从事joomla开发多年了。

<div class="category-list<?php echo $this->pageclass_sfx;?>">

<?php
$this->subtemplatename = 'articles';
echo JLayoutHelper::render('joomla.content.category_default', $this);
?>

</div>

This would be simple schematic of final render: 这将是最终渲染的简单示意图:

<div class="category-list">
...
[part I can't find]
<h2>Category title</h2>
<div class="category-desc">...</div>
[/part I can't find]
default_articles.php >> renders table with all articles in category
...
</div>

I have managed to override all other views without any problems but this one is very elusive. 我设法覆盖了所有其他视图,没有任何问题,但是这一观点非常难以捉摸。

Thanks for any help! 谢谢你的帮助!

The file is located here: 该文件位于此处:

/layouts/joomla/content/category_default.php

To override it place a copy here: 要覆盖它,请在此处放置副本:

[YOUR_TEMPLATE]/html/layouts/joomla/content/

You can read more about Joomla layouts here: 您可以在此处阅读有关Joomla布局的更多信息:
Sharing layouts across views or extensions with JLayout 使用JLayout在视图或扩展之间共享布局

Have a look at layout overrides in joomla 看看joomla中的布局替代

http://docs.joomla.org/Layout_Overrides_in_Joomla http://docs.joomla.org/Layout_Overrides_in_Joomla

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM