Textpattern Forum

You are not logged in. Register | Login | Help

#961 2011-11-08 09:47:38

Algaris
Member
From: England
Registered: 2006-01-27
Posts: 394

Re: glz_custom_fields

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

#962 2011-11-08 12:05:30

Algaris
Member
From: England
Registered: 2006-01-27
Posts: 394

Re: glz_custom_fields

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

#963 2011-11-08 12:11:42

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 5,979
Website

Re: glz_custom_fields

Algaris wrote:

  1. - 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

#964 2011-11-08 12:20:29

Algaris
Member
From: England
Registered: 2006-01-27
Posts: 394

Re: glz_custom_fields

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

#965 2011-11-08 13:40:19

Algaris
Member
From: England
Registered: 2006-01-27
Posts: 394

Re: glz_custom_fields

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

#966 2011-11-08 19:27:24

maruchan
Member
From: Ukiah, California
Registered: 2010-06-12
Posts: 564
Website

Re: glz_custom_fields

Install the bot_wtc plugin. It allows you to assign each custom field a CSS class.

Offline

#967 2011-12-08 21:03:03

Mats
Member
From: Sweden
Registered: 2011-01-16
Posts: 30
Website

Re: glz_custom_fields

Hi Gerhard

I donated earlier today, any chance you can send me the link to download?

Thanks,
Mats

Offline

#968 2012-01-24 06:42:51

jstubbs
Moderator
From: Hong Kong
Registered: 2004-12-13
Posts: 2,190
Website

Re: glz_custom_fields

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

#969 2012-01-24 06:55:16

johnstephens
Plugin Author
From: Harrisonburg, VA
Registered: 2008-06-01
Posts: 834
Website

Re: glz_custom_fields

<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

#970 2012-01-24 09:18:32

jstubbs
Moderator
From: Hong Kong
Registered: 2004-12-13
Posts: 2,190
Website

Re: glz_custom_fields

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

Board footer

Powered by FluxBB