J3 Issue ?
avatar brianteeman
brianteeman
13 Jan 2019

Not possible to have multiple layouts for a blog category

Steps to reproduce the issue

Create a template override for blog.php and rename it to new.php

Expected result

This is available in the category options AND in the menu options

Actual result

The new layout is only available in the category options

Menu item option

image

Category option

image

Create an xml

Various advice says to create an xml file for the layout but all that does is to create a NEW menu type - it still doesn't appear in the layout options

Additional comments

This has been reported before #5549 and closed as not a bug by @rdeutz - no idea how that conclusion was reached.
There was also a bug report by @astridx #15547 which @Bakual investigated and concluded that if there was an xml then it wouldnt appear in the list of layouts for which he wrote a PR #18159

However I still dont appear to be able to find any method to get the new layout listed in the options

If this is "by design", which escapes me, then the option shouldnt be present as it can never do anything

avatar brianteeman brianteeman - open - 13 Jan 2019
avatar joomla-cms-bot joomla-cms-bot - change - 13 Jan 2019
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 13 Jan 2019
avatar mbabker
mbabker - comment - 13 Jan 2019

Isn't that "Choose a Layout" option on the menu item the one to set the article layout for that category's items?

The menu item defines the layout (which is why there is a category list and category blog menu item for the two category layouts), so you wouldn't be setting a layout in the menu item's edit screen usually.

avatar brianteeman
brianteeman - comment - 13 Jan 2019

I see that yes you are correct that is what it does - which to me is wrong. All the other options below that one refer to the code in blog_item.php

avatar brianteeman
brianteeman - comment - 13 Jan 2019

in other words you can set alternative layouts for an article at both the article and the menu level but if you want an alternative layout for a category then you have to either create a new type of menu item or apply it at the category level.

avatar mbabker
mbabker - comment - 13 Jan 2019

In other words you can set alternative layouts for an article at both the article and the menu level

Unless I'm reading too fast you can't change the layout in the edit menu item screen for a single article. You've got the template style option and that's all. If you're trying to use an alt layout as a menu item you need the menu item XML file (source, looking at what we have on company site using this stuff).

avatar brianteeman
brianteeman - comment - 13 Jan 2019

It could just be a UI issue. You correctly identified that the first field in the options tab "choose a layout" refers to the article layout not the layout that can be selected at the category level BUT all the subsequent fields refer to the blog layout not the article layout

avatar brianteeman
brianteeman - comment - 13 Jan 2019

In other words you can set alternative layouts for an article at both the article and the menu level but if you want an alternative layout for a category then you have to either create a new type of menu item or apply it at the category level.

This was a mistaken by me

avatar mbabker
mbabker - comment - 13 Jan 2019

If I'm reading just the UI right, that whole Options tab is weird. Because it looks like that is a mix of options that are going to apply to what ends up being the default_item.php or blog_item.php layouts (for either category menu item type) and options that get propagated into the article view and set when the menu item params merge forward (i.e. that layout option, stuff like Show Icons or Show Create Date could be included here, don't have an IDE open and not tracing all this merge logic to know for sure at the moment).

So yeah, figuring out a way to reorganize the UI is probably the best resolution here.

avatar brianteeman
brianteeman - comment - 13 Jan 2019

I think your conclusion is correct

avatar chmst
chmst - comment - 13 Jan 2019

So yeah, figuring out a way to reorganize the UI is probably the best resolution here.

Yess!


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/23533.
avatar brianteeman
brianteeman - comment - 14 Jan 2019

@chmst @mbabker Now that it is clear that it is a UI issue it is simple to resolve. However as this would be classed as a new feature it will only go into 3.10 or 4.0

As 3.10 will not be released until 2020 and 4.0 UI is being redesigned in secret I am not prepared to write the code myself and wait a year for it to be released. Also it is not clear if 3.10 will be allowed to have a new feature - the release leads are not replying to comments :(

I guess I will just have to remember that the UI is broken

avatar AndySDH
AndySDH - comment - 15 Jan 2019

This was already brought up here: #18424

As @Bakual said:

The menu items are based on the layouts. It doesn't make sense to select a menuitem for a specific layout and then change that layout in its parameters.
Eg "category blog" and "category list" refer to the same view, but different layouts within that view.

I guess what he says is correct. By implementing this feature, you would be able to create a "Category Blog" menu and then change the layout to "Category List"... it wouldn't make too much sense.


However, you can indeed select a layout override for the Articles that will be opened from that category menu item. As this was added with: #14802 (and referred here: #18150)

So:

In other words you can set alternative layouts for an article at both the article and the menu level but if you want an alternative layout for a category then you have to either create a new type of menu item or apply it at the category level.

I think what you said here is actually correct, you weren't mistaken.
So as it is now, you can set an alternate layout for articles opened through a category menu, but not an alternate layout for the category itself (for reasons above).

avatar brianteeman
brianteeman - comment - 15 Jan 2019

As concluded already it is a UI issue that someone can address if they desire

avatar AndySDH
AndySDH - comment - 15 Jan 2019

I personally don't think there is any UI issue. Or at least, it's not "just" a matter of UI.

The "Options" tab when creating a Category Blog pertains to the articles options relate to both the blog view as well as when opening the full articles. So I don't think there is UI confusion there.

The only thing that would make that more understandable is split the options in "Blog Layout options" and "Full Article options", and replicate the same set options twice, once for the blog, once for full article.

But that would mean adding more functionallity, and not just a change of UI.

And either way, the UI issue has nothing to do with the issue stated in the opening post. As it doesn't pertain to selecting a layout for category blog/list. That is not possible either way for reasons explained by @Bakual in my quote.

avatar Bakual
Bakual - comment - 15 Jan 2019

Changing the text to "Choose Article Layout" or something similar would solve this if I understand it right.
Or moving the select field to another place.

avatar AndySDH
AndySDH - comment - 15 Jan 2019

Changing the text to "Choose Article Layout" or something similar would solve this if I understand it right.
Or moving the select field to another place.

Yes, that would probably be a language improvement for the article layout thingy. But it's not at all related to the category layout proposed by @brianteeman in this issue, just want to make sure to clear up any possible confusion that arised.

avatar brianteeman
brianteeman - comment - 15 Jan 2019

Changing the text to "Choose Article Layout" or something similar would solve this if I understand it right.

Almost but not quite. As you also need to make clear which of the following options propagate to the article layout etc

avatar Bakual
Bakual - comment - 15 Jan 2019

True enough ?

avatar volandku
volandku - comment - 20 Jan 2019

Found this bug today.
Any patch and merging in 3.9.3 ?

avatar AndySDH
AndySDH - comment - 20 Jan 2019

Found this bug today.
Any patch and merging in 3.9.3 ?

Huh? This is not a bug, there is no bug to fix

avatar volandku
volandku - comment - 20 Jan 2019

But I cant create new blog override as I did earlier

avatar AndySDH
AndySDH - comment - 20 Jan 2019

I think you're confusing something. That option is for the Article Layout, not the Blog layout.

avatar volandku
volandku - comment - 20 Jan 2019

Oh,well, tnx
Who knew, specially in russian translation

avatar volandku
volandku - comment - 20 Jan 2019

Well, where can I set my blog layout in menu?

avatar volandku
volandku - comment - 20 Jan 2019

I saw same guide, but this is new menu type.
I`m afraid any problems with routing, cause its based on menu (and it types)

avatar AndySDH
AndySDH - comment - 20 Jan 2019

Well, up to now a new menu type is and has always been the only way to create an alternative blog layout for Joomla. That's how the system is set up, there is no other way.

Again, the reason:

The menu items are based on the layouts. It doesn't make sense to select a menuitem for a specific layout and then change that layout in its parameters.
Eg "category blog" and "category list" refer to the same view, but different layouts within that view.

avatar AlekVolsk
AlekVolsk - comment - 20 Jan 2019

Follow this guide: https://www.joomlashack.com/blog/joomla/custom-category-layout/

These are crutches for the disabled, not a solution.

avatar AlekVolsk
AlekVolsk - comment - 20 Jan 2019

Wouldn't it be easier to add a blog override option for the category menu item? Why these dances with a tambourine with the creation of the type of menu?

avatar AndySDH
AndySDH - comment - 20 Jan 2019

I'm not saying it wouldn't be easier. I'm just explaning that's how the system is now for the reasons explained by @Bakual.

Changing the system would mean also making the "category list" layout an alternative layout instead of a separate menu item. So I guess that would be a pretty big change to how that has always worked.

avatar brianteeman
brianteeman - comment - 20 Jan 2019

you can create an override - its just if you want an alternative eg an extra layout that you need a menu

avatar mbabker
mbabker - comment - 20 Jan 2019

While we're continuing a thread of comments unrelated to the actual issue here...

The definition of a menu item is a specific layout of a specific view of a specific component. If someone wants to rewrite half of core to support menu items having a configurable layout inside the edit menu item screen, by all means go for it. But, this is a pretty major architectural change and unless someone gets on it now to include it in 4.0 sanely it could not be merged until 5.0 development starts.

avatar franz-wohlkoenig franz-wohlkoenig - change - 4 Mar 2019
Status New Discussion
avatar franz-wohlkoenig franz-wohlkoenig - change - 28 Mar 2019
Category com_menus
avatar franz-wohlkoenig franz-wohlkoenig - change - 4 Apr 2019
Labels Added: J3 Issue
avatar franz-wohlkoenig franz-wohlkoenig - labeled - 4 Apr 2019
avatar brianteeman brianteeman - change - 6 May 2019
Status Discussion Closed
Closed_Date 0000-00-00 00:00:00 2019-05-06 21:49:07
Closed_By brianteeman
avatar brianteeman brianteeman - close - 6 May 2019
avatar Bodge-IT
Bodge-IT - comment - 30 Aug 2019

I know this issue is closed but it hasn't gone away. My expectation of this option was that it allowed you to select from the available overrides for jLayouts associated with the menu item. In this case adding to category_default.php with category__override_.php in /layouts/joomla/content. If not and there is no way to affect the select list, then closing the issue doesn't help. Let's remove the option?

avatar SharkyKZ
SharkyKZ - comment - 30 Aug 2019

@Bodge-IT you're confusing JLayouts with view layouts. The option is working correctly. It's just the label that's confusing.

Add a Comment

Login with GitHub to post a comment