Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#73 2007-12-06 00:49:30

Neko
Member
Registered: 2004-03-18
Posts: 458

Re: glz_custom_fields

Hello gerhard, this is awesome. I can provide the Italian translation if you’re interested.

Offline

#74 2007-12-10 06:19:30

variaas
Plugin Author
From: Chicago
Registered: 2005-01-16
Posts: 402
Website

Re: glz_custom_fields

for text input do you default to a 256 character limit?

Offline

#75 2007-12-10 06:43:26

iblastoff
Plugin Author
From: Toronto
Registered: 2006-06-11
Posts: 1,197
Website

Re: glz_custom_fields

variaas wrote:

for text input do you default to a 256 character limit?

yes i think so (and why textareas for custom fields are not an option yet). i believe gerhard is working on escaping out of that limitation for the next major release of this plugin.

Offline

#76 2007-12-10 20:59:45

Logoleptic
Plugin Author
From: Kansas, USA
Registered: 2004-02-29
Posts: 482

Re: glz_custom_fields

iblastoff wrote:

i believe gerhard is working on escaping out of that limitation for the next major release of this plugin.

That would be outstanding!

Offline

#77 2007-12-10 21:13:30

variaas
Plugin Author
From: Chicago
Registered: 2005-01-16
Posts: 402
Website

Re: glz_custom_fields

good to know…thanks!

Offline

#78 2007-12-10 21:27:14

variaas
Plugin Author
From: Chicago
Registered: 2005-01-16
Posts: 402
Website

Re: glz_custom_fields

Can we look at adding portlet functionality?

Offline

#79 2007-12-10 22:15:02

Logoleptic
Plugin Author
From: Kansas, USA
Registered: 2004-02-29
Posts: 482

Re: glz_custom_fields

variaas wrote:

Can we look at adding portlet functionality?

Although giving developers and/or administrators (“Publisher” user level) the ability to move UI elements around the screen could be handy, I think it would only produce confusion for less advanced users. Besides, I’m not sure the kind of thing you linked to is even possible with the current markup structure of the Write tab.

Offline

#80 2007-12-14 06:30:16

Logoleptic
Plugin Author
From: Kansas, USA
Registered: 2004-02-29
Posts: 482

Re: glz_custom_fields

Bug Report: Because of the id attributes that it uses for replaced custom fields, glz_custom_fields is incompatible with any plugin that attempts to use the DOM method getElementById to single out custom fields on the Write tab.

In the glz_custom_fields_replace function, the plugin uses the custom field’s name for the id attribute of the on-page field. Textpattern, however, has a quirk in this department: it uses the field names with a hyphen instead of an underscore for this same attribute (e.g. custom-8 instead of custom_8). Other plugins that have been built with this in mind won’t work if glz_custom_fields is enabled.

Because other plugins assume that custom fields will be basic text inputs, you only need to fix this in the part of glz_custom_fields_replace that deals with that type of field.

This:

case "text_input":
  $custom_set_value = fInput("text", $custom_set, $custom_value, "edit", "", "", "22", "", $custom_set);
  break;

becomes this:

case "text_input":
  $custom_id = str_replace('_', '-', $custom_set);
  $custom_set_value = fInput("text", $custom_set, $custom_value, "edit", "", "", "22", "", $custom_id);
  break;

This fix has been tested to work on the installation that first demonstrated the bug for me (with upm_file_popper). I’d be interested in hearing if it works for others as well, without causing unforeseen problems.

My thanks to Gerhard for the awesome plugin. I hope this little patch is useful for him and others.

Offline

#81 2007-12-30 21:08:36

Logoleptic
Plugin Author
From: Kansas, USA
Registered: 2004-02-29
Posts: 482

Re: glz_custom_fields

I’d like to ask a favor of some glz_custom_field users. I just released a new custom field plugin that I originally developed for use in combination with Gerhard’s (though you can use it alone). I’ve never had a chance to test it on custom fields beyond 10, however, and I’m fresh out of time to set up a new test site for this purpose. Could someone give it a spin and let me know if this works? Thanks!

Offline

#82 2007-12-31 01:36:22

redbot
Plugin Author
Registered: 2006-02-14
Posts: 1,410

Re: glz_custom_fields

Adam,
very useful! Now I can use more than one checkbox for a single custom field (using delimiter=”|”).
For your question, I made a quick test and unfortunately it doesen’t seem to work with custom fields beyond 10. Anyway it works perfectly until 10.

Offline

#83 2007-12-31 02:57:44

Logoleptic
Plugin Author
From: Kansas, USA
Registered: 2004-02-29
Posts: 482

Re: glz_custom_fields

redbot wrote:

very useful! Now I can use more than one checkbox for a single custom field (using delimiter=”|”).

Keep in mind that you can’t count on the third checkbox in your group always being the third in the custom field’s value. Empty spots aren’t filled in when, for example, you check the third of three options. So instead of ||option3 you just get option3. It’d actually be nice to see that fixed, since it would make a conditional tag for checkboxes much easier to create (you could use mine, for example ;-).

For your question, I made a quick test and unfortunately it doesen’t seem to work with custom fields beyond 10. Anyway it works perfectly until 10.

That’s disappointing, but not too surprising. It has some similarities to the built-in <txp:custom_field /> tag, which also doesn’t work for 11 or more fields. Thanks for looking into it for me. :)

Can anyone tell me how the $thisarticle array gets populated? That seems to be the source of this particular problem, and if I knew how it works I might be able to figure out a work-around.

Offline

#84 2007-12-31 17:13:20

redbot
Plugin Author
Registered: 2006-02-14
Posts: 1,410

Re: glz_custom_fields

Logoleptic wrote

Keep in mind that you can’t count on the third checkbox in your group always being the third in the custom field’s value. Empty spots aren’t filled in when, for example, you check the third of three options. So instead of ||option3 you just get option3. It’d actually be nice to see that fixed, since it would make a conditional tag for checkboxes much easier to create (you could use mine, for example ;-).

Yes I know, I was thinking the same at first time, but I was wrong.
Actually – when using checkboxes – this should not be a problem at all: I can use conditional with no problem like this:

<txp:aam_if_scf name="colors" delimiter="|" val="blue">
do something
</txp:aam_if_scf>

If you think well about it you can see you never need to use the offset attribute ‘cause you never need to know the value of a single checkbox. You only need to know if it is checked or not so this is not a problem (I hope I was clear enough)
For you question about the $thisarticle array I cannot answer now cos I’m in a hurry. If I have some free time in next days I’ll let you know

Last edited by redbot (2007-12-31 17:20:31)

Offline

Board footer

Powered by FluxBB