User tests: Successful: Unsuccessful:
This PR adds the possibility to define a specific Alternative Layout for the Article which is displayed in a:
Create an Alternate Layout for your article and create these three Menütypes
Select in each Menutype your alternate layout and see that the layout settings on the Articles that are called FROM this views are applied.
Status | New | ⇒ | Pending |
Category | ⇒ | Front End com_content |
Whilst I do understand the logic of this (and it's annoyed me before). There is a reason for this behaviour. If you pick a category blog menu option for example then you override it with a different article type then you end up with super confusing behaviour
@wilsonge i understand, but how can following scenario be solved then:
User is submitting content to a specific category. All Articles of this Category should be shown with an Alternate Layout (because of specific custom fields stuff). The User who is submitting has no possibility to chose a layout.
Hi @wilsonge I have the same "problem" with the alternative layouts than @coolcat-creations so I think this PR makes a lot of sense.
Could you explain further, the "super confusing behavior"?
I have tested this item
Works perfectly. I don't see any reason not implementing this PR. If a user get a strange behaviour (not sure which one) he/she can deactivate the parameter...
I have tested this item
Status | Pending | ⇒ | Ready to Commit |
RTC
If a user get a strange behaviour (not sure which one) he/she can deactivate the parameter...
This is exactly why the PR needs to be adequately tested. The behaviors need to be documented and the way menu item parameters are merged understood to know what the actual desired behavior will be. If you set this parameter on a category menu item and have a different value on the article, which is the value used?
Yes, this is a desirable feature, but it needs to be tested beyond "new parameter shows up, sweet!". Suggest RTC removed, a full test scenario is written up for possible paths, and that tested first.
Not sure about that. It's the same behaviour as all the other parameters with this combination
If it is we're good. But given George's comment on the matter and me knowing that menu item parameter merging with other items is tricky, it would be good if we had explicit test scenarios confirming this. Right now the way this PR reads, it basically says "make sure the menu item parameter is applied and works". It does not do anything with testing whether if the parameter is set at the article level, whether the article's parameter "wins" over the menu item as an example. It's that more involved path that needs better documented testing IMO.
Status | Ready to Commit | ⇒ | Pending |
Yep, I guess it wasn't clear from me, I fully agree with you, I just wanted to know, what is missing in your point of view.
Status | Pending | ⇒ | Needs Review |
@coolcat-creations can you please test what @mbabker suggested?
@franz-wohlkoenig yes - added to my todos tomorrow.
@coolcat-creations If you could write automated tests for that, it would be great. If you can not do that with code, no problem: Just write down the test cases in plain English, so we can turn it into code. You can use this pattern:
Given: (any preparation step, fx. "I am logged in into the backend")
When: (a list of actions, fx. "I go to the Article Manager" and "I create a new article with title 'Test1'")
Then: (a list of expected results, fx. "I see the first article having h1.class 'default'" and "I see the second article having h1.class 'alternate'")
Hello!
Finally:
Expected Result: "All" Articles beside Testarticle 1 are shown in the assigned menutypelayout Layout. Testarticle 1 has an assigned specific Layout (articlelayout.php) - this Setting is "deeper" and so it´s expected that it´s shown in the other layout.
Repeat Step 1 - 5 for Category List, and for List view with ANOTHER Testcategory and items
Unexpected Results are caused by:
These two cases are caused by a bad site-architecture and planning and IMHO not relevant.
Priority:
See if A-Layout is set in an Article
IF NOT
See if A-Layout ist set in Blogview in Menuitem this Article is part of
IF NOT
See if there is an Alternate Layout in Global Options for Articles
See if A-Layout ist set in Blogview
IF YES
Display Articles with A-Layout
See if A-Layout is set in an Article
IF YES
Display Articles with specific A-Layout
I hope this makes the issue more clear. Not sure if the unexpected result part can be removed by improving the router. It would be definetly good to improve the overview and User Experience of Alternate Layout and Override setup at all. (J4 ?)
@mbabker is your Comment answered by @coolcat-creations?
@mbabker is your Comment answered by @coolcat-creations?
As long as it's tested out and the parameter merging isn't causing unintended side effects (which it sounds like is the case, minus the deep rooted architectural issues which exist without this PR anyway), this is fine by me.
Status | Needs Review | ⇒ | Information Required |
waiting on @zero-24 and @dgt41 before setting RTC as @bembelimen stated.
Make 1. to 6. how coolcat-creations commentend at 10.May
But if you now change in the menu-item to an other TemplateStyle(for example from Protostar to Beez)
Menuitem with Testcategory Blog View -> Details -> Template Style
Then works the menutypelayout furthermore with the Beez-Template
But you dont see this in the menu-item at:
Menuitem with Testcategory Blog View -> Options -> Choose a Layout
If you now save it again then is come the expected result(view without the override from the other Template). Save it twice after change to an other Template Style then you have correct "view".
Similar same as in #16755 and #8578
If RTC this new feature without solve the bug, then needs additional "documentation" or "warning" or not ?
I dont know that.
I would suggest to open a new issue about that. As far i understand you, you don't see alternate/custom menu-types (alternate layouts with own .xml) although you can select their alternate layout in the Article. That has not really something to do with those PRs.
I think you misunderstand me.
I make all (alternate layout for articles in the Template Protostar) and all others from 1. to 6. what you wrote in this PR at 10.May
and then all works as expected but:
if i then change Details -> Template Style (for example from Protostar to Beez) in the menu-item that was created at your point
6. Create a Menuitem with Testcategory Blog View, ...
then works the menutypelayout furthermore with the Beez-Template in this menu-item.
But you dont see that in this menu-item at:
Options -> Choose a Layout
If you now save it again then is come the expected result(article-view without the
alternative-article-layout-override from the other Template). Save it twice after change to an other
Template then you have correct "view".
@coolcat-creations no because my english is not good.
I know your PR is not direct the reason of the bug. The bug its relate to
filed type componentlayout, how shamsbd71 explain.
That layout parameter should save with a value like "template_name:layout_name" when saved to the database, and when used in the PHP API, that template name segment gets parsed by the view class to figure out that it needs to change the active template, how mbabker explain.
I dont find an other place in joomla who this bug have an affect.
But if your PR would merge without a solution for the bug, i dont know is it need for additional "documentation" or "warning" or not ?
For example in the:
COM_MENUS_ITEM_FIELD_TEMPLATE_DESC="Select a specific template style for this menu item or use the default template."
to:
COM_MENUS_ITEM_FIELD_TEMPLATE_DESC="Select a specific template style for this menu item or use the default template. If you use an alternative layout save twice for correct function."
and / or at the help-sites:
https://help.joomla.org/proxy/index.php?option=com_help&keyref=Help37:Menus_Menu_Item_Article_Category_Blog
https://help.joomla.org/proxy/index.php?option=com_help&keyref=Help37:Menus_Menu_Item_Article_Category_List
I dont know that.
@coolcat-creations no because my english is not good.
@Sieger66 @coolcat-creations is from germany too ;) So that should not be the issue
@Sieger66 @zero-24 @franz-wohlkoenig
Seems that the issue from Sieger66 is an expected behaviour and has nothing to do with this PR.
(After assigning a new template style to your menüitem, you have to apply the change to be able to select an override from that template)
Can we set it RTC?
@mbabker as Release Lead can you please have a Look at Question above by @coolcat-creations?
I have tested this successfully and use it in a project
Status | Information Required | ⇒ | Fixed in Code Base |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2017-09-02 15:45:27 |
Closed_By | ⇒ | mbabker |
I have tested this item✅ successfully on 6756d87
OK tested successful
This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/14802.