? Failure

User tests: Successful: Unsuccessful:

avatar shamsbd71
shamsbd71
6 Dec 2015

Description

When we create any new Joomla! Menu with : Articles => Single Article, we cant set the layout for it. It will load always default.php

Before

article_before

Desired Output

If we add these patch, its allow to set the alternative layout for article details page. So i can see all layouts for article details page and set any one to load for specific page or menu item.

After

article_after

Comment

Though its already been checked in view.html.php for article.

avatar shamsbd71 shamsbd71 - open - 6 Dec 2015
avatar shamsbd71 shamsbd71 - change - 6 Dec 2015
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 6 Dec 2015
Labels Added: ?
avatar shamsbd71 shamsbd71 - change - 6 Dec 2015
The description was changed
avatar Bakual
Bakual - comment - 6 Dec 2015

The single article menu item is already specific to a layout. An alternative layout doesn't make any sense here.
If you want to create a menu item using your alternative layout, you need to add a corresponding xml file to it. Then you can choose it as an own menu item.
See https://docs.joomla.org/Layout_Overrides_in_Joomla

avatar Bakual Bakual - change - 6 Dec 2015
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2015-12-06 14:08:56
Closed_By Bakual
avatar Bakual Bakual - close - 6 Dec 2015
avatar Bakual Bakual - close - 6 Dec 2015
avatar mbabker
mbabker - comment - 6 Dec 2015

The way you've described requires then to use a custom layout that all single article views must be assigned to a menu item, whereas this change (if I've understood it right, admittedly this parameter/field isn't one I've worked with much) allows it to be defined directly in the article's settings and doesn't bind the possibility of an alternative layout to the menu system.

avatar brianteeman brianteeman - change - 6 Dec 2015
Status Closed New
Closed_Date 2015-12-06 14:08:55
Closed_By Bakual
avatar brianteeman brianteeman - reopen - 6 Dec 2015
avatar brianteeman brianteeman - reopen - 6 Dec 2015
avatar brianteeman
brianteeman - comment - 6 Dec 2015

Thanks for this PR it is very useful and consistent with other com_content views

avatar Bakual
Bakual - comment - 6 Dec 2015

this change allows it to be defined directly in the article's settings and doesn't bind the possibility of an alternative layout to the menu system.

@mbabker No, it's not about the article settings. You already can specify an alternative article layout in the article settings itself. This is about the single article menu item itself. Technically it's even an alternative layout for the specific menuitem for the "default" layout.

@brianteeman No, it's not consistent with any other views anywhere in core. It makes no sense because you already selected a specific layout with the menu item itself.
Also we don't use alternative layouts in menu items so far. At least I'm not aware of a single one. We use them at the category and article settings itself (not the related menu items).
Eg for a category view, you can't select an alternative category layout.

avatar sovainfo
sovainfo - comment - 6 Dec 2015

Any PR that makes things more consistent is welcome to me. As far as I know settings are determined by the menu item allowing to set it there or decide to use either the item or component setting.

By the way, this is what the options tab of the component has to say:

These settings apply for article layouts unless they are changed for a specific menu item.
Choose a Layout

Suggesting this can be overridden at menu item level!

avatar Bakual
Bakual - comment - 6 Dec 2015

Suggesting this can be overridden at menu item level!

Yeah, you override it when you create a menu item for a single article. Because that menu item is tied to a specific layout ("default" in this case).
In Joomla core every menu item you can create is specific to a layout. Because the XML file defining the menuitem is the one at the layout level.
That's why you can select between two different menuitems for the category view (blog and list) because you choose the layout for the category view with the menu item there (overriding any settings done elsewhere).

avatar sovainfo
sovainfo - comment - 6 Dec 2015

Indeed the trick applied to the category blog/list is just wrong! You should be able to pick an alternate layout just like any other situation. Obviously you should only be presented with the blog layouts or list layouts. Probably requires a blog and list view instead of the current category.

No wonder this very difficult to understand and document. It just confirms that the implementation is wrong!

avatar Fedik
Fedik - comment - 6 Dec 2015

For Single Article menu item I agree with @Bakual . There the layout already selected, I not see much sense allow to do it again ...

But it can be a good idea to be able to select the layout for Single Article layout in the Blog Menu item, so you can specify "full view" layout for the blog article ... there also just need to add one more menu option :smile:

avatar Bakual
Bakual - comment - 6 Dec 2015

Indeed the trick applied to the category blog/list is just wrong!

Nah, it was a decision that goes back to I think 1.6 that menu items are based on layouts.
They can also be based on views (metadata.xml) or component (don't remember the filename here) but for core we always used the layout approach since then.
One can agree or disagree with that of course, but it's the intended way for quite some time now.
Main reason probably was that you can have different (custom) parameters for each layout/menuitem.

In my own component I use view menuitems and let the user decide on a layout in the component and menuitem settings, but you face other issues there due to the way Joomla menus are working. :smile:

avatar Bakual
Bakual - comment - 6 Dec 2015

But it can be a good idea to be able to select the layout for Single Article layout in the Blog Menu item, so you can specify "full view" layout for the blog article ... there also just need to add one more menu option

There are already two PRs open for that. Also created by @shamsbd71.
It will be a new feature and certainly needs also good testing with behavior how layout settings in article itself will be overriden (article should take precedence over menuitem over global setting)

avatar sovainfo
sovainfo - comment - 6 Dec 2015

It is not a matter of specifying it again. Each menu item type has a default layout (most of the time called default in core components). Obviously when not overridden it would take that one.

Strikes me as strange to have the possibility to create a template override but not for an alternate layout. Just because a mistake was made at the time J1.6 was introduced, not the only one either.
Do see a tendency to keep them instead of acknowledging them and accepting fixes!

avatar shamsbd71
shamsbd71 - comment - 7 Dec 2015

Each menu item type has a default layout

That's the point. if i want to make a different presentation, i had to create a new xml and view both for category list, category blog, single item.
But when i'm creating a menu, its dedicated. It can save a lot of time and work if i have these options for regular menu?
if by making a very single change can save us a lot of work : creating xml and apply all things and maintain with others updates and joomla core options those will be applied time to time.

avatar bertmert
bertmert - comment - 7 Dec 2015

OT:

Indeed the trick applied to the category blog/list is just wrong!

I agree with that. Settings in this combined view are confusing and conditions in model annoying.

Probably requires a blog and list view instead of the current category.

Yep!

avatar Bakual
Bakual - comment - 7 Dec 2015

Having bloig and list using the same view is absolutely correct. The data that is shown is identical. Just the display is different. That's exactly the job of a layout. And since they have different parameters, we need two XML files as well.

I don't unterstand what the problem is with creating an XML file. As soon as it is there, the alternate layout becomes an alternate menuitem and you can do what you want.

avatar Fedik
Fedik - comment - 7 Dec 2015

... i had to create a new xml and view both for category list, category blog, single item.

copy paste copy paste copy paste ... easy ... what the problem? :smile:

Now imagine situation.

  • You make the menu item from Default.xml layout and selected there MyFancy layout,
  • then someone create menu from Another.xml layout and selected HisFancy layout ...
  • after some time you decide that you need additional parameters for MyFancy and make MyFancy.xml ... but for apply it you need create new menu
  • then someone else will make menu item from MyCool.xml and select your MyFancy layout...
  • and so on ...

after all you will end up to debugging to find where thing comes from :smile:

avatar shamsbd71
shamsbd71 - comment - 7 Dec 2015

Here is two Single Article Menu and New Article Options
1. Menu options for single article
menu_info
2. Article option when we create
article_info

we have all options repeated everywhere.
1. Global options
2. Article Edit
3. Menu Item

** Category edit is missing. there suppose to be some options too :(

so to be consistent, the common options should be only in once in one place or it should be everywhere it belongs to.

to avoid argument : please think for regular process. this is how we deal with it.

and

when we need extra parameters for any new item, then our existing solution is like this

Create new.xml, new.php
and for your information:
joomla form field type componentlayout only show those layouts in dropdown when it dosent belongs to any xml.

so if you have a layout thats for new.php. you will not see that from default.xml menu items.

avatar Bakual
Bakual - comment - 7 Dec 2015

I'm far from saying the current system is perfect. But I think this PR makes it even worse.
Ideally, common parameters would be defined in components or view level and Layouts only defined layout specific params.

The reason why the componentlayout field doesn't show alternative menuitem is likely because they are supposed to have custom parameters. However that thought is flawed anyway. We may change that so all Layouts are shown.

avatar brianteeman brianteeman - change - 28 Mar 2016
Category Components
avatar brianteeman brianteeman - change - 10 May 2016
Status New Pending
avatar franz-wohlkoenig
franz-wohlkoenig - comment - 6 Jan 2017

@Bakual should this be tested?

avatar Bakual
Bakual - comment - 6 Jan 2017

Imho it should be closed. But since I already closed it once and someone else reopened it again, I'm not going to close it myself again.

avatar franz-wohlkoenig
franz-wohlkoenig - comment - 6 Jan 2017

Thanks @Bakual, so i gonna ask @brianteeman if this PR should be tested.

avatar Bakual
Bakual - comment - 6 Jan 2017

Unfortunately, @brianteeman will not be able to answer it for another two months or so.
pinging @joomla/cms-maintainers

avatar franz-wohlkoenig
franz-wohlkoenig - comment - 11 Mar 2017

Asking @brianteeman if this PR should be tested.

avatar mbabker
mbabker - comment - 21 May 2017

As this PR has had no update in well over a year, it will be closed in a few weeks as abandoned if it doesn't start getting attention.

avatar franz-wohlkoenig franz-wohlkoenig - change - 22 May 2017
The description was changed
Status Pending Information Required
avatar joomla-cms-bot joomla-cms-bot - edited - 22 May 2017
avatar joomla-cms-bot joomla-cms-bot - change - 22 May 2017
Category Components Front End com_content Components
avatar franz-wohlkoenig
franz-wohlkoenig - comment - 27 May 2017

If this PR get no Response, it will be closed at 22. June 2017.

avatar franz-wohlkoenig franz-wohlkoenig - change - 22 Jun 2017
Status Information Required Closed - No Reply
Closed_Date 0000-00-00 00:00:00 2017-06-22 03:55:00
Closed_By franz-wohlkoenig
avatar joomla-cms-bot joomla-cms-bot - close - 22 Jun 2017
avatar franz-wohlkoenig
franz-wohlkoenig - comment - 22 Jun 2017

closed as stated above.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/8603.

avatar joomla-cms-bot
joomla-cms-bot - comment - 22 Jun 2017

Add a Comment

Login with GitHub to post a comment