You are not logged in.
Thank you redbot. That’s very good to know.
Gerhard: Would it be possible for you to add an option when creating a new Text Area Custom Field to specify its text length? This would save me having to jump into PHPMyAdmin. I’m always afraid I’ll break something if I make a mistake while editing the tables.
Offline
I went into the Textpattern table to edit custom_10 which is the custom field I’m using for my text area. In PHPMyAdmin I changed the Type entry from VARCHAR to LONGTEXT and hit save. I then received the following error message which seems to be very similar to the error message I originally had when I created the text area using glz_custom_fields.
Error
SQL query:
ALTER TABLE `textpattern` CHANGE `custom_10` `custom_10` LONGTEXT CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT ''
MySQL said:
#1101 - BLOB/TEXT column 'custom_10' can't have a default value
I also tried to change the value for custom_2 as redbot suggested and received the same error message.
Offline
Algaris wrote:
#1101 – BLOB/TEXT column ‘custom_10’ can’t have a default value
You need to remove the DEFAULT '' from the end of the query to get rid of the error. So if you have a default value set for that column in phpMyAdmin, clear it before saving the changes.
The smd plugin menagerie — for when you need one more gribble of power from Textpattern.
Txp Builders – finely-crafted code, design and Txp
Offline
Thank you Bloke. The Dafault entry was set to As defined from its drop down. When I changed it to None everything worked.
I guess this means for each custom text field I have on the Write tab I’ll have to edit its entry in PHPMyAdmin.
Offline
One more quick question. If I wanted to style a custom field I’ve created with glz_custom _fields (such as increasing its width and height) is there an easy way to do so with CSS?
Offline
Install the bot_wtc plugin. It allows you to assign each custom field a CSS class.
Offline
Been looking through this thread to find out how to find the value of a select type of custom field – say for example we have select options One, Two and Three within a custom field named Content_type.
How to display content if the value ==Three? Something like this:
<txp:if_custom_field name="Content_type{Three}">
<div class="image"><txp:body /></div>
</txp:if_custom_field>
TXP Tips | @txptips | Me | @jonathanstubbs | Github
TXP Builders – finely-crafted code, design and txp @txpbuilders
Offline
<txp:if_custom_field name="Content_type" value="Three">
<div class="image"><txp:body /></div>
</txp:if_custom_field>
I can’t remember using the select field for something right now, but I think this is how the if_custom_field tag works.
Offline
Oh boy I completely forgot about the value="" check in the if_custom_field tag….!!
TXP Tips | @txptips | Me | @jonathanstubbs | Github
TXP Builders – finely-crafted code, design and txp @txpbuilders
Offline