-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[4.0] Add next PATH to override other components layouts #32720
Comments
Why not |
Because, in my opinion:
- when Administrator adds new template and marks it as default - layouts
overriding is lost;
- there is a need to implements special procedures to install and uninstall
overridden layouts;
- this is complementary to layouts overriding mechanisms for system's
layouts (E.G.
"administrator\components\com_associations\layouts\joomla\searchtools\default.php"
or
"administrator\components\com_modules\layouts\joomla\form\field\modulespositionedit.php")
<https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>
Wolny
od wirusów. www.avast.com
<https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>
<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
śr., 17 mar 2021 o 18:22 Brian Teeman ***@***.***> napisał(a):
… I know there is possiblity in global template but this is not realy
usefull.
Why not
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#32720 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AO2O2WOYKOQLM2G7PJSUSHTTEDP7HANCNFSM4ZK65KVA>
.
--
-------------------------
Maciej Bednarski
|
So, since you already coded your component then why don't you implement that yourself, eg joomla-cms/administrator/components/com_media/controller.php Lines 33 to 68 in 2dab92f
There's nothing missing from the API's perspective that stops you doing whatever you want with your layouts |
Again. In Joomla4 I want to use the 'com_category' component in my programmable component (com_myComponent). In the manifest file, I create a menu item:
"...
<menu link = "option = com_categories & amp; extension = com_myComponent.itemstype" view = "categories" > COM_MYCOMPONENT_ITEMS_TYPE </menu>
... ".
This entry calls com_categories with its own layout files. The question is, how can I overwrite or add new layout files to
com_categories? I know I can use Templates overwrite, but it's not very elegant. The administrator can always change the Template, delete it. In addition, such an overwritten template will probably be visible globally for all components and users. As a developer of com_myComponents, I have no control over it. In my opinion, the problem would be solved by adding an
additional PATH pointing to the directory:
'./administrator/components/com_myComponent/layouts'
in the "getDefaultIncludePaths" method of the "FileLayout" class. The "FileLayout:: getDefaultIncludePaths ()" method could get information about the component calling component 'com_categories' from the URL from the parameter 'extension'. Another solution may be that the component ('com_myComponent') can register a new PATH to the standard PATH list. What
do I need this for? I want to be able to list the categories ('com_myComponent.itemstype') added to my component in a simplified way by adding additional specific information. I want to add an additional tab in the "edit.php" layout in which the user will enter additional information.
Maybe the above can be achieved in another way? Please give me a tip.
|
@variax73 please start the title using "[4.0] " as this issue seems for joomla 4, if i understand correct. |
You can add a category.xml to your component backend to extend the form and add additional fields to com_categories. That should solve for issue. We will not add such an additional path for overrides to the CMS. You should not modify one component from another component. |
Is your feature request related to a problem? Please describe.
I need to override in my developed component layout from other component (E.G. "com_categories"). I know there is possiblity in global template but this is not realy usefull.
Describe the solution you'd like
Please add in standard list PATH to override, one more PATH, to developed component. Now the list looks like thiis:
'..\administrator\templates/atum/html/layouts/com_categories'
'..\administrator/components/com_categories/layouts'
'..\administrator\templates/atum/html/layouts'
'../layouts'
I need a list like this:
'..\administrator/components/com_MyComponent/layouts'
'..\administrator\templates/atum/html/layouts/com_categories'
'..\administrator/components/com_categories/layouts'
'..\administrator\templates/atum/html/layouts'
'../layouts'
Name of new component can be taken from URL's extension like this:
.../index.php?option=com_categories&extension=com_MyComponent.itemstype&layout=itemstype
Alternative solution is adding function to registration of the new PATH in initialisation or better instalation of a new component.
Additional context
The text was updated successfully, but these errors were encountered: