Page 1 of 1
CTLModuleMaker - length of name field
Posted: Fri Apr 08, 2011 11:50 am
by raymondo
Hi,
I'm a novice at creating modules so please excuse what is probably a basic question.
I am using CTLModuleMaker to create a news item database and want to use the 'name' field of an item to hold the headline of the item. The problem is the field is automatically created and it has it's length restricted to 32 characters. This is not long enough for my purpose and I would like to change it but I cannot see where this is defined in the module installation etc. There is nothing in the blueprint file that I can edit.
Can someone point me to where the name field of an item is defined in the instalation process of a module created with CTLModuleMaker?
Thanks,
Ray
Re: CTLModuleMaker - length of name field
Posted: Sun Apr 10, 2011 9:26 am
by klenkes
Try to insert this into your ... after the "name" parameter.
removed by moderator
Set it to 64 or whatever you want.
I didn't try it because I never needed it, but it should work.
Re: CTLModuleMaker - length of name field
Posted: Sun Apr 10, 2011 4:42 pm
by raymondo
klenkes wrote:Try to insert this into your Blueprint.php after the "name" parameter.
Hi,
Thanks for the help but I cannot see where the 'name' field is defined in the bluprint.php file. I can see where the fields that I have created are defined but not where the ones that are automatically created are. All there is, apart from the definitions of my fields, is...
'lvlid' => 'lvl2',
'name' => 'newsitem',
'name_singular' => 'newsitem',
'name_plural' => 'newsitems',
'femode' => 'closed',
'indexed' => '1',
'autonomous' => '1',
'normal_user' => '1',
'fe_allow_new' => '',
'adminfields' => array(
'0' => 'name',
'1' => 'active',
'2' => 'section'
)
Should I edit that part?
Ray
Re: CTLModuleMaker - length of name field
Posted: Thu Mar 29, 2012 9:17 am
by andrewvideo
Has anyone work it out. I would love to know how to change maxchar for just the name. Its not in the blueprint.
Anyone help.
Cheers
Re: CTLModuleMaker - length of name field
Posted: Thu Mar 29, 2012 11:21 am
by klenkes
andrewvideo wrote:Has anyone work it out. I would love to know how to change maxchar for just the name. Its not in the blueprint.
Right! The standard fields that come with a module cannot be edited through the blueprint.
The standard fields have a restriction in the database.
For example: name | varchar | 32
Have you tried editing the size/length value for the field in the database?
Re: CTLModuleMaker - length of name field
Posted: Fri Apr 06, 2012 10:16 am
by andrewvideo
The work around it is make new field name title and then you hide Alias in your template (en_US.php) rename 'Name to Alias. Its auto fills in the Alias filld in automatic anyway.
$lang["module_name"] = "Name";
>>
$lang["module_name"] = "Name to Alias";
then you go you edit_*****.tpl
remove
<div class="pageoverflow">
<p class="pagetext">{$item->alias->Label()} :</p>
<p class="pageinput">{$item->alias}</p>
</div>
Hope this helps
sorry if my writing to crap.,
Andrew