Do components over-ride everything?

Aaron Michael Posted in Component Development 6 years ago

What order does the components load and do they over-ride everything? For example; If I were to make a component to change the website's color based on if people are mobile or not, would it load that component over-write the colors of the default theme, as long as I got the code right?

Replies
ph Rally Homelancer Replied 6 years ago

As for the overwriting everything. Basically yes they do. Especially if you want to overwrite things like the CSS and/or "intercept" some hooks or call backs. Except maybe for some core functions. Which you can actually create your own sub-core functions something like a framework and call your custom codes from it.

ph Rally Homelancer Replied 6 years ago

When you do a ossnregistercallback() to initialize your component there is a default priority of 200. If you want your component to initialize before the other component you can specify the priority like 100.

For example: ossn_register_callback("ossn", "init", "my_component",100);

This loads/initializes the "my_component" before the other components with the default priority. And if you want your component to load/initialize last, you can use a value like 999.