Loading...
 
Features / Usability

Features / Usability


Assign custom module to registration page?

posts: 29
How can I assign a custom module to just the registration page (tiki-register.php)?
posts: 212

Hello sholzy,

I do not find an easy way to put a custom module on the registration page. Maybe someone else has a better way, but here are two options you could consider.

You could sort of do it by adding a registration user tracker. When there is a user tracker (User Tracker) the tracker's description is added at the top of the registration page, and you could specify that the description should be wiki parsed, and then use the module plugin to display your module in the description.
But that doesn't give you a lot of options for where you can put it. (I have not tested this, but I have put plugins into user tracker descriptions before successfully.)

And It would be nice if the registration page had been set up as a Section that you could specify under the module's visibility, but that isn't in the current code. Maybe it will be added some day.

If you are willing to modify the code, you could add section visibility support for the registration page. It would require you to edit 2 files and add a couple of lines to each of them.

First edit /lib/setup/sections.php
There is an array of "sections" created near the top and you can add a section for "register" to the array.

After the code:

// tra('Newsletter')
        'newsletters' => array(
                'feature' => 'feature_newsletters',
                'key' => 'nlId',
                'objectType' => 'newsletter',
        ),


Add in a new array entry for register so it looks like:

// tra('Newsletter')
        'newsletters' => array(
                'feature' => 'feature_newsletters',
                'key' => 'nlId',
                'objectType' => 'newsletter',
        ),
        'register' => array(
                'feature' => 'allowRegister',
                'key' => '',
                'objectType' => 'register',
        ),


Then edit /tiki-register.php and add 2 lines.

Before the line:

require_once ('tiki-setup.php');

Add a new line so it looks like this:

$section = 'register';
require_once ('tiki-setup.php');


And then before the lines:

$smarty->assign('mid', 'tiki-register.tpl');
$smarty->display('tiki.tpl');


Add a new line so it looks like this:

include_once ('tiki-section_options.php');
$smarty->assign('mid', 'tiki-register.tpl');
$smarty->display('tiki.tpl');


Now when you add the custom module, in the "Parameters" option, put "section=register" and your custom module will display on the Registration page.

Tom