If you create a category blog override you cannot copy and rename the files as Joomla totally ignores them. You have to edit the 'blog' files. This means that if you want to change the layout of category blogs it will change the layout for EVERY category blog.
Generally, this might be ok, but in my case I have added custom fields with associated css classes for a specific category to the category article layout so that the fields are automatically in the correct layout when the user creates a new article in that category.
(e.g. in line 113 of mytemplate/html/com_content/article/concert.php I have added after the "articleBody" line:
<div class="concert-subheading"><?php echo $this->item->jcfields[3]->value; ?></div>
<div class="concert row">
<div class="col-md-9 concert-image"><?php echo $this->item->jcfields[12]->value; ?></div>
<div class="col-md-3 concert-programme"><?php echo $this->item->jcfields[17]->value; ?></div>
</div>
The CSS classes referenced include background colours so, because, unlike featured articles, it's not possible to have a secondary blog layout it means that ALL blog layouts now include these fields (some of which have been set as compulsory, so that would/could cause problems for non-category articles) and ALL category blog articles now look like this:
Enable multiple category blog overrides
Labels |
Added:
?
|
Title |
|
On J3.9x or just J4?
I tried that in J3.9x and included a new XML file, too but it was ignored.
on both. you use the xml to define a new menu type eg second_blog
I do this all the time
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2019-10-25 08:54:17 |
Closed_By | ⇒ | Scrabble96 |
My mistake. I'd named a featured articles override and category blog override with the same file name and I'd copied over the layout part of the xml without changing the 'option' tag. Closing now. Sorry.
This can already be done.
The other layouts would be called
second.php
second_items.php
second_links.php