Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2019-12-22 15:27:15

Dragondz
Moderator
From: Algérie
Registered: 2005-06-12
Posts: 1,536
Website GitHub Twitter

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

#2 2019-12-22 16:23:12

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,433
Website GitHub

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

#3 2019-12-22 22:17:23

phiw13
Plugin Author
From: Japan
Registered: 2004-02-27
Posts: 3,152
Website

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

Offline

#4 2019-12-22 22:41:11

Dragondz
Moderator
From: Algérie
Registered: 2005-06-12
Posts: 1,536
Website GitHub Twitter

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

#5 2019-12-22 22:46:49

phiw13
Plugin Author
From: Japan
Registered: 2004-02-27
Posts: 3,152
Website

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

Offline

#6 2019-12-22 23:13:45

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,433
Website GitHub

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

#7 2019-12-23 08:26:53

Dragondz
Moderator
From: Algérie
Registered: 2005-06-12
Posts: 1,536
Website GitHub Twitter

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

#8 2019-12-23 08:38:17

phiw13
Plugin Author
From: Japan
Registered: 2004-02-27
Posts: 3,152
Website

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

Offline

#9 2019-12-23 10:51:21

Dragondz
Moderator
From: Algérie
Registered: 2005-06-12
Posts: 1,536
Website GitHub Twitter

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

Board footer

Powered by FluxBB