0

I have a page with modules and components from the same extension. I made some customizations to the component's template file so when the page loads it gets the current user's avatar from some external resource and update it to one of the component's tables. This avatar is also used by the modules on the same page. So I need to make sure the PHP code in the component's template is executed before the module's PHP code is executed, otherwise the avatar in the module won't show up.

So, is the component exectued before the module?

0

The component is always dispatched before the modules. But you might want to reconsider your code. Such dependency doesn't sound like a good idea.

1
  • Thanks. I know it is not good practice but it is the easiest way for now.
    – shenkwen
    Feb 22 at 22:39
0

If you look at your active template, most of the cases in the file called index.php.

You can find a tag to render the component:

<jdoc: include type = "component" />

And some others to render the modules according to their position:

<jdoc:include type="modules" name="top" style="xhtml"/>

This one will render modules in the "top" position.

Therefore some modules are rendered before and others after the component according to the order they are placed in the template.

Hope this can help

1
  • Thanks, it is good information. I am using gantry template, it is more complicated than normal template.
    – shenkwen
    Feb 22 at 20:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.