This plugin sits under the Extensions tab in the back-end and gives your custom fields new life. You can finally have custom fields that are selects, multi-selects, checkboxes, radios and textareas – besides the default input fields. You can predefine values for custom fields and you can select a single default value (selects, multi-selects, checkboxes and radios only). Rather then constantly typing in the same thing over and over again, just select or check it and you’re set.

The plugin doesn’t require any hacking of TXP, it’s a straight install with instant gratification. Also there’s support for special custom fields as well.

Re: glz_custom_fields

colak wrote:

Hi gerhard can you please clarify what you mean when you say “unless you have left the custom fields as they were”.

OK, imagine custom_1_set is of type text input and you change it to select (or anything else) and then pre-define some values for it. If after this you try to edit an article which has for custom_1 a value which is not among the predefined ones, the value won’t be selected – and you won’t be able to select it – and thus when hitting save, the article’s custom_1 value will become blank.

The plugin won’t delete any values automatically. However, I see your point and that’s why the question you have raised will be addressed in v1.0 (check the new features list).

redbot wrote:

I’m missing: the possibility to set a default value for custom fields.

Re: glz_custom_fields

Hi Gerhard,

Thanks for opening a new thread for this excellent plugin. What I miss so far is some examples of how to use the plugin – I think there is only one example in the help – are there any more examples available?

Re: glz_custom_fields

jstubbs, most of the plugin is meant for the back-end, there are only 2 front-end functions so far – the ones documented in the help. All of the custom fields specific functions which come with TXP will work as expected. The only grey area is when one wants to use the custom fields above 10. There is one crucial function within TXP which imposes a hard limit on the custom fields, getCustomFields() in publish.php. A lot of other functions use it, so I would basically have to slightly modify all of them – which is a pig as you might imagine. Ideally, the core developers will be sympathetic enough towards this plugin to make the 2 line modification to getCustomFields() that will sort out this mess. I will make another mod request on the dev list shortly, just giving people enough time to try the plugin out and see whether they are willing to implement the change.

So, to wrap it up, use the same functions that you would for normal custom fields on the front-end and get back if something doesn’t work as expected. Hope that answers your question.

Re: glz_custom_fields

hey hey. before i drop a donation, i was wondering if the plugin is capable of this:
(might be too unorthodox for most. im not sure):

say i wanted a dropdown box for a custom field. would there be a way to grab image category names and automatically pull them in as values to choose from? (whether via some dirty hack or some php magic to slap into the “values” area. as long as it works.).

im asking because i’m currently using rss_thumbpop for a site and the way its set up, the user has to manually type an image category name into a custom field, and then the plugin takes that image category name to output a specific gallery for that article.

To do that, I can right now create a radio-custom-field with the defaults, add a “special” default choice, and a second custom field that will be used only if the “special” radio box is checked. A little complex to set up and use, but more important it’s less user friendly.

Another suggestion: local, context, explanations (micro documentation). From the user point of view, maybe he has a Help button for each custom field, or an overlay that appear when he select this specific custom field area. Of course, the webmaster would have to write the micro-documentation (probably at the same stage as setting up the custom field and choices themselves).

Another one: what about using this for keywords? In a multiple-authors website, it’s easy to misspell keywords. If I write a Texpattern article on a blog, what’s his keyword: textpattern, Textpattern, TXP? And there’s the possibility of typos. So when the article’s keywords area is selected, the user would have an (alphabetically sorted) overlay of existing keyword. He can click to the ones he wants, or add his new ones (that will be displayed for the next use of this functionality).

Last suggestion (for now :-p): the ability to create new choices (default data) for custom field (when appropriate). A little like the last suggestion, but this time for custom field. The user can select among many options (choices) written by the webmaster, but he can also create new ones for that custom field, and use them.

Re: glz_custom_fields

Gerhard,
I have a problem with the <txp:glz_custom_fields_article /> tag.
When the search should give no results all articles are listed instead.
It happens either when one clicks “submit” without specifing a value and when values are specified but no articles matching are found.
In all other cases it works properly.
I don’t know if this is caused by something I did wrong or is a bug.
Ah …thanks for including default values in the next version ;-)

Re: glz_custom_fields

iblastoff wrote:

[…] would there be a way to grab image category names and automatically pull them in as values to choose from?[…]

This is also what I have in mind. I’m already pleased with the semi-automatic version that this plug-in provides, since the values for a select are behind administrator-rights and provide a solution against spelling-mistakes as well as pre-defined values for the authors.

I will definitely participate in this request somehow. And it should be taken on step further…

Jeremie wrote:

As for suggestions: what about the capability to have unique or multiple choices, but the option of entering a free one?

If this is not already done good enough in the plug-in admin table, tags for retrieving and updating an options-list would be a start. If this list can be linked to say image- categories by yet another tag, then I would call it mission accomplished.

A good example for this scenario would be a list of locations for reoccuring events or a list of teachers in a school. People come and go and the contents of a corresponding select could be updated automatically from a separate list that links to whatever (for example articles in the section “teachers” or “locations”).

iblastoff wrote:
[…] the user has to manually type an image category name into a custom field, and then the plugin takes that image category name to output a specific gallery for that article.

This is a good example for the need to link the contents of a drop-down to e.g. an image-subcategory list.

Last edited by ooz (2007-09-17 06:23:15)

“Habit is probably the greatest obstacle of perceiving truth.” R.A. Schwaller de Lubitz

Re: glz_custom_fields

iblastoff wrote:

say i wanted a dropdown box for a custom field. would there be a way to grab image category names and automatically pull them in as values to choose from? (whether via some dirty hack or some php magic to slap into the “values” area. as long as it works.).

I think you are hinting here at trigger words, same thing as with ranges. This is very interesting from a programming point of view, it got me all excited : ). It’s definitely doable and has already been included on the new features list. The functionality that you are talking about here will be known as |Image Categories| (so that we know it’s a trigger expression).

Jeremie wrote:

I can provide a French translation, no problem.

Great! Let me know if there is anything you need to get started on this!

what about the capability to have unique or multiple choices, but the option of entering a free one? & the ability to create new choices (default data) for custom field

Yes, definite yes! At the bottoom of the select/checkbox/radio there will be another input field for specifying new values. However, this will enable users to insert values in the default lists, the admins will have to check them every now and then for consistency. I’ll have a function in place that will check and remove duplicates but that’s about as much as I can do.

local, context, explanations (micro documentation)

Excellent idea! From what I can tell so far, this plugin is set to grow and, after a while, documentation will become more and more necessary. Consider it a feature for v2.0.

redbot wrote:

When the search should give no results all articles are listed instead. It happens either when one clicks “submit” without specifing a value and when values are specified but no articles matching are found.

When no value is specified, it’s normal that the search returns all results because you aren’t constraining them in any way. When no articles are matched though, the <glz_custom_fields_article /> will re-direct to no_results section though (as you could see in the screencast). Is this not working for you?

ooz wrote:

A good example for this scenario would be a list of locations for reoccuring events or a list of teachers in a school. People come and go and the contents of a corresponding select could be updated automatically from a separate list that links to whatever (for example articles in the section “teachers” or “locations”).

Yes, trigger words. I could think of the following trigger words so far:

|Image Categories|

|File Categories|

|Article Categories| (will include the nice tree view that is available under Category tab)

Re: glz_custom_fields

gerhard wrote:
When no value is specified, it’s normal that the search returns all results because you aren’t constraining them in any way. When no articles are matched though, the <glz_custom_fields_article /> will re-direct to no_results section though (as you could see in the screencast). Is this not working for you?

Ok Gerhard you’re right, I was trying to get this to work in a wrong way…
and yes, when no value is specified it’s normal that the search returns all results
everything works fine now
thanks