Customization in Osclass plugins by Madhouse

Tutorials

Our plugins for Osclass are fully customizable to suits any of your customization needs but it doesn’t mean that you need to modify the code.

This post will give the keys to customization of our plugins.

Now that the Osclass market is up and well, flourishing with awesome plugins and themes, updating is so much easier but modifying the code of a plugin will only make it harder to update. Be clever and make it clean by following those simple steps.

1- Prepare your theme

First, create a folder within your own theme:
/oc-content/themes/{YOUR_THEME}/plugins/{PLUGIN_NAME}/

Where:

  • {YOUR_THEME}, is the name of your theme;
  • {PLUGIN_NAME}, is the name of the plugin you want to customize;

2- Default theme

Don’t start from scratch, the default theme is not only there to make it quicker to install our plugins, it also serves as an example for your custom theme. We almost always provide a default theme based on Bender and it will always be located in:
/oc-content/plugins/{PLUGIN_NAME}/views/web/

For example, if you want to customize the inbox of our famously known personal messaging system plugin, just copy the default inbox file located in:
/oc-content/plugins/madhouse_messenger/views/web/inbox.php

Into the new folder, you just created:
/oc-content/themes/{YOUR_THEME}/plugins/madhouse_messenger/inbox.php

3- Cleanup!

You might have to clean some things before going further.

First, take a close look to the first line of the file, if it mentions a call to the function below, remove it from the new file in your theme.

<?php Madhouse_Utils_Plugins::overrideView(); ?>

Then, make sure to replace all the mention to the plugin or to mdh_current_plugin_name() by the name of your theme, especially in translation functions (_e(), __()).

4- Let speak your imagination…

From there, you are on your own, so you can modify those new files within your theme in any way you want.🙂

Osclass is great because it has been designed with modularity in mind. It enables us to make great plugins for Osclass to extend the core, modify its behavior or simply add new features like a personal messaging system.

See you, chimps !

One thought on “Customization in Osclass plugins by Madhouse

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s