Scope of templates files in module

Hello!
I have question…
Scope of templates files in module?

I mean i have two modules and one template:

  1. “MyCUstom” template where i have tpl file “layout/page.tpl” - content: “Lorem Ipsum from template”
  2. “MyModule1” where i have tpl file defined in ‘templates’ tag like “layout/page.tpl” - content: “Lorem Ipsum 1”
  3. “MyModule2” where i have tpl file defined in ‘templates’ tag like “layout/page.tpl” - content: “Lorem Ipsum 2”

And now if i will use “layout/page.tpl” in module “MyModule1” it should shows me “Lorem Ipsum 1” or “Lorem Ipsum 2” or what?

Next question is… can i use tpl files from template in modules? For example header and footer for sending mails?

I think it’s not possible to override standard templates in modules. You can either define your own templates (with your own template name) in “templates” array or you can override blocks in “blocks” array. You can override standard templates in custom theme.

soo if in MyCustomModule1 i will define ‘templatenamealfa’ can i use it in other module MyCustomModule2?

Should work, but i have not tried this.

You can extend render() function and return your own template instead of default template