Name field is too short

Postdate: April 4 2012
Category: Created Modules
Applies to: 2.x

Noticed that the Name field, and btw the Alias field only have a max-lenght of 32 characters? That's sometimes way too short!  There is more than one solution to this!


The problem is that the length values of the database fields are set to 32 characters. So you can either make them longer or work around this restriction.

1st Solution

Connect to your database with your preferred database tool(I suggest MysqlDumper) and edit the tables properties. Change the values from 32 to 50 or whatever you want, as long as the value doesn't eceed 255.

2nd Solution

Don't touch the database!
During module creation create another field with the name: longname or title and give them a length of max. 255.

In your template substitute all references of $item->name with $item->longname or title
This is my preferred way of doing it, because there is another advantage to this approach.

The advantage:

After a reindex of all content(SEARCH module) the standard fields are no longer in the index! (Seems like a bug) But the custom created fields are! That's better.