简体   繁体   中英

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.

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.

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. I don't quite understand what files it's calling since I haven't been in joomla development for ages.

<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:
Sharing layouts across views or extensions with JLayout

Have a look at layout overrides in joomla

http://docs.joomla.org/Layout_Overrides_in_Joomla

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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