Include and load new JS in OssProfile

Dani MR Posted in Beginning Developers 9 years ago

Hello!

If I need to include a JS of my component in OssnProfile.

¿Is it necessary include in ossncom.php of OssnProfile?
OR
¿Is it possible include in my ossn
com.php of myComponent and use in OssnProfile?

ossnnewjs(');
ossnloadjs();

Thanks!

Replies
Spanish Dani MR Replied 9 years ago

I undestand, thank you.

Is it the same way (readmore component) for include Vendors?

Thanks

German Michael Zülsdorff Replied 9 years ago

There's a basic rule with Ossn:
Don't touch core files.
And that means core components (= all components which start with "Ossn...."), too.

If your component would rely on an altered core component, not only people would lose functionality with every new Ossn Update - you had to keep track of every new update, too, and apply your changes again and again. No good idea, right?

Have a look at the Readmore component as an example how to extend Ossn with Javascript which is system-wide usable.

https://www.opensource-socialnetwork.org/component/view/174/readmore