Module Development Questions.

Good evening,

     I hope you all faired well tonight.  My dev plans fell through and I ended up drinking with some good people.  Now this has nothing to do with the questions I am about to post but when drinking sometimes we over share.  :-P

 

So I have a module I created to list businesses because what I need is not in any solution on the market.  (Mind you Modzzz had a pretty bad ass business listing module, but it was not exactly what I needed)

 

Hence Smack is trying to do Dolphin 7.1 Module development!  (The audience cheers in the background, they were paid to do so. Now go with it.) 

 

Here are the problems I have not figured out yet, or have not found documentation to explain.

 

1. How do I create a template php file for a create / add form and have it called by the add method?

 

2. How do I reference a related table for a new object type?  (Object type being the main table for the business style listing module I created)  I want to add a rating table with a variety of rating selections that a member can vote on once.  This requires two additional table to the main listing table with the way I have structured it.  I have not found anything yet explaining how to do this.

 

3. I want to add a picture to my module.  What is the proper process for doing this?

 

4. Many modules have a blue icon after the input field on the create form.  This has text that is loaded by a language key.  How is this done?

 

 5. How do I add a new module to the default site stats?  (hehe)

 

I know that this is a lot but if you have a document I should read please tell me where it is.  These are the major issues I am having with my module development at the moment.  I would pay someone to do this but I just quit my job to chase a dream.  So know that helping me will provide good Karma!  :-)

Many thanks!

Cory  

A.K.A Smack

Quote · 17 Feb 2013

Have you looked at the bloggie tutorial in the help section yet?

I am not understanding half your questions as you not using function names as a reference point.

Example your first question. How do I create a template php file for a create / add form and have it called by the add method?

Templates are html files. Not php. Whats this add method?

The tutorial on how to create a module covers database tables and form generation. You should look at it. http://www.boonex.com/trac/dolphin/wiki/DolphinTutorialMyFirstModule


https://www.deanbassett.com
Quote · 17 Feb 2013

My bad.  Let me explain question 1 in greater detail.

 

In the Dolphin Tutorial (myfirstmodule) it explains how to modify the main and view html files.  Located in the Modulename/templatesbase

 

I see how I can change the layout of these files to add field and load the data from the database via the Dolphin API (I guess that is what it is called)

 

I do not understand how I use a form for the function actionAdd in the ModuleNameConfig.php.

 

What I am asking in this question is how do I make the function actionAdd use a custom html file I create and put in the Modulename/templatesbase directory?

 

Thank you,

Cory

 
Quote · 17 Feb 2013

First off. The actions are to be put in ModuleNameModule not in ModuleNameConfig. The config class is used for config data only. Look at some of modules included by boonex to see what normally goes in the config file.

Anyhow. look at the class MeBlggModule

In the     function actionHome () {

Is an example. That function passes an array of variables to the template named main.

You can either design you own form in the template or you can use dolphins form generator.

In the bloggie example there is a form created at the top of the class in MeBlggModule

It is used in that same file in the function actionAdd

In there it is echoed out using echo $oForm->getCode ();

But you can put that in a variable as well $myForm = $oForm->getCode ();

Then you can pass $myForm to the template as shown in the actionHome function.




https://www.deanbassett.com
Quote · 17 Feb 2013

To better learn dolphin API for creating modules, the best module to use as example is the site module. It has examples of everything that you want and it rewrites most of the functions into its module object, so you can better see what's happening and how to do it.

Quote · 17 Feb 2013

Thank you guys!  I am jumping back into this now so I will be working on the site most of the night.  Good info.  If I can get this stuff done this week, I am going to start loading the data in my site and I hope to start marketing it in the next week.

 

Cory

Quote · 18 Feb 2013
 
 
Below is the legacy version of the Boonex site, maintained for Dolphin.Pro 7.x support.
The new Dolphin solution is powered by UNA Community Management System.