?
avatar Scrabble96
Scrabble96
24 Oct 2019

Is your feature request related to a problem? Please describe.

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:

cat-blog-override

Describe the solution you'd like

Enable multiple category blog overrides

Additional context

avatar Scrabble96 Scrabble96 - open - 24 Oct 2019
avatar joomla-cms-bot joomla-cms-bot - change - 24 Oct 2019
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 24 Oct 2019
avatar Scrabble96 Scrabble96 - change - 24 Oct 2019
Title
Feature request: enable second category blog layout
Feature request: enable multiple category blog layouts
avatar Scrabble96 Scrabble96 - edited - 24 Oct 2019
avatar Scrabble96 Scrabble96 - change - 24 Oct 2019
The description was changed
avatar Scrabble96 Scrabble96 - edited - 24 Oct 2019
avatar brianteeman
brianteeman - comment - 24 Oct 2019

This can already be done.

The other layouts would be called
second.php
second_items.php
second_links.php

avatar Scrabble96
Scrabble96 - comment - 24 Oct 2019

On J3.9x or just J4?
I tried that in J3.9x and included a new XML file, too but it was ignored.

avatar brianteeman
brianteeman - comment - 24 Oct 2019

on both. you use the xml to define a new menu type eg second_blog
I do this all the time

avatar Scrabble96 Scrabble96 - change - 25 Oct 2019
Status New Closed
Closed_Date 0000-00-00 00:00:00 2019-10-25 08:54:17
Closed_By Scrabble96
avatar Scrabble96
Scrabble96 - comment - 25 Oct 2019

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.

avatar Scrabble96 Scrabble96 - close - 25 Oct 2019

Add a Comment

Login with GitHub to post a comment