Not possible to have multiple layouts for a blog category
Create a template override for blog.php and rename it to new.php
This is available in the category options AND in the menu options
The new layout is only available in the category options
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
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
Labels |
Added:
?
|
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
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.
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).
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
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
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.
I think your conclusion is correct
So yeah, figuring out a way to reorganize the UI is probably the best resolution here.
Yess!
@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
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).
As concluded already it is a UI issue that someone can address if they desire
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.
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.
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.
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
True enough
Found this bug today.
Any patch and merging in 3.9.3 ?
Found this bug today.
Any patch and merging in 3.9.3 ?
Huh? This is not a bug, there is no bug to fix
But I cant create new blog override as I did earlier
I think you're confusing something. That option is for the Article Layout, not the Blog layout.
Oh,well, tnx
Who knew, specially in russian translation
Well, where can I set my blog layout in menu?
Follow this guide: https://www.joomlashack.com/blog/joomla/custom-category-layout/
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)
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.
Follow this guide: https://www.joomlashack.com/blog/joomla/custom-category-layout/
These are crutches for the disabled, not a solution.
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?
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.
you can create an override - its just if you want an alternative eg an extra layout that you need a menu
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.
Status | New | ⇒ | Discussion |
Category | ⇒ | com_menus |
Labels |
Added:
J3 Issue
|
Status | Discussion | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2019-05-06 21:49:07 |
Closed_By | ⇒ | brianteeman |
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?
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.