I’ve been looking for a simple tutorial, explaining how to add a custom module to the Oxid backend. After searching in the forum in vain I decided to write an article in the Oxid wiki:
[QUOTE=wanis;33083]
do not touch /admin/menu.xml !!
[/QUOTE]
I postponed separation of the module from the core files, because I wanted to keep the first steps as simple and painless as possible. I will adress this issue in the next step of the wiki article. BTW I had lots of problems with a separate module folder…
[QUOTE=wanis;33083]
you must return template name in modulename::render.
[/QUOTE]
I’ll put that into the php file in the next step. I reduced the render function to a minimum to get output, and that’s all that was left.
Hi Regard
I want to develop a module for back-end. I have read your articles about creating module but there are some points that I didn’t get from any where.
I know that I should place menu.xml in my folder file containing information about my plugin link on back-end.
Now I want to know the information about my other files my classes, tpl files and my lang file. Where should I place these files. In common practice my classes are placed in admin/ folder, tpl files in out/admin/tpl folder and lang files in out/admin/lang folder. Can I place them in my module folder? If so then what will be the directory structure? Should it be the same as in scattered pattern?
How to place my tpl files, calsses and lang files in my module folder? I have placed all files at the root of my module folder. But I am getting error at main view of admin (“Translation for my module not found”)
You can place your lang files in yourmodulefolder/out/lang/de etc., but i think there is no way to keep all the files inside your modulefolder, especially the templates and classes. You can reference your modulefolder from templates and classes with getModuleUrl from 4.5.0 upwards, don’t know for sure if this also works in backend:
to make some use of your module folder, but the main template will still have to be in admin template folder, and your own view classes in the admin folder.
Ok. If want to show different screen then how can i do this. For example When i click on my module name on admin navigation it shows a screen. I have shown a form on the first screen. On submission of the form I do some calculation and if calculation goes right then I want to show a different template.
I have tried to do it this way…
if ($result['status'] == 'success')
{
$user_id = $result['data']->user_id;
//enter data in export product table
$db->Execute("INSERT INTO f_users (email,user_id ) VALUES ('{$data['email']}','$user_id')");
// this is the class which is having different template file. I have called its render function. The control goes to that function but it is not rendered.
$froomerce_shopcreation = new froomerce_shopcreation();
$froomerce_shopcreation->render();
}
i am a newbee, in your article you didn’t mention about the metadata.php file. and now i am on OXID 4.9 version. do i need to create the metadata.php file, because my menu doesn’t shows up when i am placing it in a seperate module. Please help
Hi Bikash (?)
Since writing the turorial I haven’t been working with Oxid anymore, so I can’t help you with the menu system that was introduced after version 4.3. I’m sure other knowledgeable members can give you a tip.
you definitely have to create a metadata.php file and place in your module root as well as the menu.xml. Then empty the template cache and you should at least see the menu entries.