Replies: 7 comments
-
I think you have to override it from a theme not a module. if you want a custom module, then maybe you should use a different editor of that field that your module exposes. |
Beta Was this translation helpful? Give feedback.
-
If I override it from a theme not a module, Template will be invalid after Customer change the theme .
|
Beta Was this translation helpful? Give feedback.
-
Yes that is correct. You could try using the Admin Template feature and create a template using the UI. Otherwise, you'll have to create a customer editor for your field that would be available when your feature is enabled. Feature, cannot override template that were composed by other features. At least, I am not aware of a way to do it. You could also override it from the web project which will override everything (themes and modules) |
Beta Was this translation helpful? Give feedback.
-
You can override a template from a module. If you override a template file with the exact same name, your module/feature should depend on the module that defines the original file, the dependency can be defined in your module Manifest file (there many examples in the source), so that you have an higher precedence. You can use the exact same file name or a more specific one depending on the Type/Part/Field names (refer to the doc for the file names, here too there are many example in the source). Unless if the current Theme already has the same file, the current Theme has an higher precedence. In that case your module can still define more or less specific template files but with different names. The Template feature has the highest precedence so you can always override a template from the admin UI, here the name should follow the template names (different than file names) conventions, refer to the doc, from memory a |
Beta Was this translation helpful? Give feedback.
-
Overriding Field Template in views folder of web is valid, but Overriding Field Template in views folder of module is invalid. |
Beta Was this translation helpful? Give feedback.
-
@effapp I never tried @jtkech. But if he said it can be done, then it can :) What he is saying that the dependency here matter. Ensure your module add reference dependency to OC.ContentFields project. Then add the view to your module which should force the view locator to find the view defined in your module. Another way you could try is by overriding the Anyway, I am converting this to a discussion. |
Beta Was this translation helpful? Give feedback.
-
Thanks. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
How to replace OrchardCMS Field default Template in the custom module, please?
Beta Was this translation helpful? Give feedback.
All reactions