Parameters not showing in module help page

Talk about writing modules and plugins for CMS Made Simple, or about specific core functionality. This board is for PHP programmers that are contributing to CMSMS not for site developers
User avatar
mungra
Forum Members
Forum Members
Posts: 13
Joined: Wed Sep 16, 2009 11:10 am

Parameters not showing in module help page

Post by mungra »

Hi,

I can't get the parameters to show in my module help page. for example:

(optional) firstparameter="1"
(optional) secondparameter="1"

i noticed in other modules that the parameters are NOT defined in de language files like es_US.php.

Can someone help?

Regards
Jos
Support Guru
Support Guru
Posts: 4020
Joined: Wed Sep 05, 2007 8:03 pm

Re: Parameters not showing in module help page

Post by Jos »

Parameters have to be defined in the file "modulename.module.php"

with for example the following line for a template parameter:

Code: Select all

$this->CreateParameter('template', 'summary', $this->Lang('help_template'));
$this->SetParameterType('template',CLEAN_STRING);
RonnyK
Support Guru
Support Guru
Posts: 4962
Joined: Wed Oct 25, 2006 8:29 pm

Re: Parameters not showing in module help page

Post by RonnyK »

mungra,

help page is coming from the translation file... In de default it takes all from the en_US lang-file... When the lang-file is updated to the non-English text, then that will show, no matter if it is up-to-date or not... Newer version of CMSMS will have a link, to show the module-help in English as well, to make sure that regardless of translation, the up-to-date English version is visible...

Better ask the moderators of the TC for your language to update, or better, join the TC team for your language ;)

Ronny
User avatar
mungra
Forum Members
Forum Members
Posts: 13
Joined: Wed Sep 16, 2009 11:10 am

Re: Parameters not showing in module help page

Post by mungra »

Jos wrote: Parameters have to be defined in the file "modulename.module.php"

with for example the following line for a template parameter:

Code: Select all

$this->CreateParameter('template', 'summary', $this->Lang('help_template'));
$this->SetParameterType('template',CLEAN_STRING);
Hi,

thanx for de fast reply!

Yes i defined my parameters like your example but there still not showing  :-\
RonnyK
Support Guru
Support Guru
Posts: 4962
Joined: Wed Oct 25, 2006 8:29 pm

Re: Parameters not showing in module help page

Post by RonnyK »

Then you should create the label in the lang-file of en_US.php as well, to tell what it should be labelled...

Ronny
User avatar
mungra
Forum Members
Forum Members
Posts: 13
Joined: Wed Sep 16, 2009 11:10 am

Re: Parameters not showing in module help page

Post by mungra »

Still doesn't work, i tried everything ???!!

Any other ideas?

Thanx!
RonnyK
Support Guru
Support Guru
Posts: 4962
Joined: Wed Oct 25, 2006 8:29 pm

Re: Parameters not showing in module help page

Post by RonnyK »

Those (optional) text is NOT coming from the module-call.... It is the direct text put in the en_US.php lang-file....

Ronny
Jos
Support Guru
Support Guru
Posts: 4020
Joined: Wed Sep 05, 2007 8:03 pm

Re: Parameters not showing in module help page

Post by Jos »

step by step:

step1
search for function SetParameters() in Yourmodule.module.php

step2
In this function you add:

Code: Select all

$this->CreateParameter('template', 'summary', $this->Lang('help_template'));
$this->SetParameterType('template',CLEAN_STRING);
Please put in the exact same code, you can adjust later

step3
Add the helptext somewhere in langfile en_US.php:

Code: Select all

$lang['help_template'] = 'specify the template you want to use.';
That should give you a parameter template in the module-help section
User avatar
mungra
Forum Members
Forum Members
Posts: 13
Joined: Wed Sep 16, 2009 11:10 am

Re: Parameters not showing in module help page

Post by mungra »

Thanx for all your help you guys! i really appreciate it!

I did acsactly what you said in your example but still no luck  :(

Can there be an error or something in my module that is preventing it from showing?

I have error reporting on and see no errors displaying.

Regards
Jos
Support Guru
Support Guru
Posts: 4020
Joined: Wed Sep 05, 2007 8:03 pm

Re: Parameters not showing in module help page

Post by Jos »

did you set debug to true in the config.php?
User avatar
mungra
Forum Members
Forum Members
Posts: 13
Joined: Wed Sep 16, 2009 11:10 am

Re: Parameters not showing in module help page

Post by mungra »

Yes i did and there are no errors
Jos
Support Guru
Support Guru
Posts: 4020
Joined: Wed Sep 05, 2007 8:03 pm

Re: Parameters not showing in module help page

Post by Jos »

does your module work correctly?

Is the language set to en_US in your personel account settings?
User avatar
mungra
Forum Members
Forum Members
Posts: 13
Joined: Wed Sep 16, 2009 11:10 am

Re: Parameters not showing in module help page

Post by mungra »

Yes my module is working correctly

everything is set to es_US in my settings.
RonnyK
Support Guru
Support Guru
Posts: 4962
Joined: Wed Oct 25, 2006 8:29 pm

Re: Parameters not showing in module help page

Post by RonnyK »

The default file that is taken is en_US not es_US....

Ronny
User avatar
mungra
Forum Members
Forum Members
Posts: 13
Joined: Wed Sep 16, 2009 11:10 am

Re: Parameters not showing in module help page

Post by mungra »

Sorry my mistake!

i did mean en_US.

Everything is set correctly and double checked everything
Post Reply

Return to “Developers Discussion”