User tests: Successful: Unsuccessful:
As explained in #7649, currently we are required to have a metadata.xml
present in the view folder and that file needs to have a title specified.
But that title isn't used for anything, the menumanager (items view) only uses the title from the layout.
If the metadata.xml isn't present, the menumanager will not show the layout title but instead shows the name (as it appears in the URL!) of the view.
See picture for what I mean
This PR proposes to make the whole file optional and as well the title attribute. If the title is specified and it is a translated string, it assumes that the developer wants to show the view title in the menu manager. The following table tries to show what changed. View and Layout column refers to if the file is present and contains a title.
View | Layout | Before | After |
---|---|---|---|
X | X | Component » Layout | Component » View » Layout |
X | - | Component | Component » View |
- | X | Component » Untranslated Viewname (URL) | Component » Layout |
- | - | Component » Untranslated Viewname (URL) | Component » Untranslated Viewname (URL) |
As you see in the above table, there is some difference in behavior. Hopefully you all agree that it makes more sense now
To avoid showing now untranslated view strings (remember, those are currently required to be in the view metadata,xml!), I added a check into that part which only shows the view title if the string is in the language file.
You can test this easily with menu items from com_content. All metadata.xml files from this extension contain an untranslated title there. So those should not show up after the PR is applied.
After applying patch, there should be no difference for most extensions.
The only core extension which will have a difference is com_wrapper. Instead of "Wrapper » Iframe Wrapper" it will now show "Wrapper » Wrapper » Iframe Wrapper".
Com_content should behave the same because the view title isn't translated.
To test, you can delete the metadata.xml of a given view and see if something changes. For the wrapper, the view should vanish and only the layout show. For com_content menuitems there should be no change.
If you delete both the xml for the layout (usually default.xml) and the view (metadata.xml) you will see that untranslated viewname from the URL.
Status | New | ⇒ | Pending |
Labels |
Added:
?
|
Excuse me for being thick but what is the benefit of showing wrapper-wrapper-iframewrapper
There is no benefit here. It could easily be removed by removing the title from the metadata.xml.
It was there before and because it is actually translated (but never was shown before) it now shows up.
I left it there so it's easier to test the PR. I can remove it in another PR.
Easy | No | ⇒ | Yes |
Category | ⇒ | Libraries |
I was always super confused about this file.
And even more about the metadata.xml file straight in some component directories.
It's actually a nice feature. That metadata.xml can contain parameters for a view instead of adding it to the layout files. In my own component I use that to avoid having to copy-paste each parameter for each layout (my layout files are just showing the same data in different layouts).
As for the metadata.xml in the component directory, that one is useless in that case. However it could be used to specify parameters which then would be used component wide (if no view or layout xml is found).
I'd vote for removal of components metadata.xml file if it's not doing anything ATM. At least for me it's confusing and I spent some time to reverse-engineer Joomla code to find out what is it for (nothing).
Ony when there is some functionality implemented, I'd reintroduce it again.
Feel free to propose a PR which removes the (empty) component metadata.xml from core where present. It's not in the scope of this PR. :)
It's just useless if there are no params defined in it, like the one you linked. If you have params, the code currently supports it.
I have tested this item successfully on
Edit: The Issues tool cut my comment...
Tested with the "All Frontend Views" menu from the testing sample data as well as with an own component that has no metadata.xml files. Looks fine to me.
This PR has received new commits.
CC: @Harmageddon
I have tested this item successfully on 806c549
I can confirm that the behavior for com_wrapper is changed. ;)
I have tested this item successfully on 806c549
Tested again as before.
Milestone |
Added: |
Milestone |
Added: |
||
Status | Pending | ⇒ | Ready to Commit |
RTC. thanks
Labels |
Added:
?
|
Status | Ready to Commit | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2015-10-17 10:16:47 |
Closed_By | ⇒ | rdeutz |
Labels |
Removed:
?
|
Milestone |
Milestone |
Added: |
Milestone |
Added: |
Milestone |
Excuse me for being thick but what is the benefit of showing
wrapper-wrapper-iframewrapper