Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Get rid of size 32 in custom field[SOLVED]
Hi,
In write panel there is a size=“32” on input field, how to get rid of it to have the 255 char that is permited by DB colonne ?
Thanks.
txp 4.7.3
Last edited by Dragondz (2019-12-23 08:27:14)
Offline
Re: Get rid of size 32 in custom field[SOLVED]
Brute force approach for all fields can be done via a plugin:
if (txpinterface === 'admin') {
register_callback('abc_cf_embiggen', 'article_ui', 'custom_fields');
}
function abc_cf_embiggen($evt, $stp, $data, $rs)
{
return str_replace('size="32"', 'size="255"', $data);
}
YMMV, as it doesn’t really do much (width is controlled by CSS).
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Txp Builders – finely-crafted code, design and Txp
Offline
Re: Get rid of size 32 in custom field[SOLVED]
What is the purpose? To make the field larger (longer) for display purposes? As far as I know, the size
attribute on an input field has no effect on the amount of text (characters) you can input in it. It only controls the physical size of the field on the page (which can easily be modified with CSS). You can still input as many characters as you want, that will be saved correctly providing you don’t go over the limit set in the DB.
Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern
Online
Re: Get rid of size 32 in custom field[SOLVED]
Thanks for replay stef, maybe think to put a pref somewhere to change it because sometimes we need to put more than 32 chars in a custom field.
To phiw13: the size limit the content that you can write on textfield, here it s set to 32 char.
Offline
Re: Get rid of size 32 in custom field[SOLVED]
I have no problems inputing an article title of 126 characters not counting white-space. The field is set to size=64
. The same goes for the custom fields size=32
or the URL-only input field. And saving them and using those values
Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern
Online
Re: Get rid of size 32 in custom field[SOLVED]
No, phiw13 is right: the size attribute doesn’t affect number of input chars – it affects the physical size of the box on-screen (which is overridden by CSS). maxlength
affects the max number of chars that can be entered, and we don’t employ that to the best of my knowledge.
If your input fields are limited in that way, is there a plugin interfering?
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Txp Builders – finely-crafted code, design and Txp
Offline
Re: Get rid of size 32 in custom field[SOLVED]
Hum,
really strange yesterday i hadent be able to put more than 32 chars in article image field, today i made another attempt and it works!!
Sorry for bothering you with false information :(
Offline
Re: Get rid of size 32 in custom field[SOLVED]
Dragondz wrote #320671:
Hum,
really strange yesterday […]
Ah, yesterday. That was the day of “El Gordo” in Spain. That usually sends all kind of disturbances in the forces :-)
Seriously, glad that it works now. If you ever find what happened, let us know.
Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern
Online
Re: Get rid of size 32 in custom field[SOLVED]
Hahaha
Yes but it s not a waste of time for me, because the chunk of code given by Stef will be useful to understund a little more about article_ui callback.
Offline