Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#731 2010-09-17 03:19:47

radneck
Plugin Author
Registered: 2005-07-03
Posts: 109

Re: glz_custom_fields

Just a quick FYI guys:

If you want to user glz_custom_fields with, for example, <txp:article_custom />’s attribute customfieldname you cannot use spaces in the custom field name. This is quite annoying when developing a site for a client, as you want the custom field to show up in the Write tab as My Custom Field and not My_Custom_Field. I think this feature is planned for a future release, but until then here’s a quick and dirty hack:

Edit the glz_custom_fields plugin and look for the following line:

"<label for=\"$custom_id\">{$custom_set['name']}</label><br />$custom_set_value", " class=\"$custom_class\""

and replace it with:

"<label for=\"$custom_id\">".str_replace('_', ' ', $custom_set['name'])."</label><br />$custom_set_value", " class=\"$custom_class\""

This will basically replace underscores in the field name with spaces when in the Write tab, but will still allow you to reference the proper name (with underscores intact) when playing around in templates and forms.

Hope this helps someone.

Offline

#732 2010-09-17 03:33:59

johnstephens
Plugin Author
From: Woodbridge, VA
Registered: 2008-06-01
Posts: 989
Website

Re: glz_custom_fields

There is also a very useful plugin that can be used alongside glz_cf for the same effect, and no hacks. I love it!

Offline

#733 2010-09-17 03:36:39

radneck
Plugin Author
Registered: 2005-07-03
Posts: 109

Re: glz_custom_fields

Yes I saw that, thought it was an great plugin – just like wet_babble but for custom fields. I just couldn’t get it to work though, I assumed it hadn’t been updated to work with the latest glz_cf. Also, I think it relies on JS (?).

Last edited by radneck (2010-09-17 03:37:28)

Offline

#734 2010-09-17 04:23:13

wet
Developer
From: Lenzing, Austria
Registered: 2005-06-06
Posts: 3,267
Website

Re: glz_custom_fields

cain-mi wrote:

Also, I think it relies on JS (?).

NB: The whole admin side relies on JS.

Offline

#735 2010-09-17 04:37:50

radneck
Plugin Author
Registered: 2005-07-03
Posts: 109

Re: glz_custom_fields

wet wrote:

NB: The whole admin side relies on JS.

What do you mean by whole admin side? Of this plugin? Or the whole Textpattern admin side?

Offline

#736 2010-09-17 04:41:21

wet
Developer
From: Lenzing, Austria
Registered: 2005-06-06
Posts: 3,267
Website

Re: glz_custom_fields

The latter.

Offline

#737 2010-09-17 04:55:53

radneck
Plugin Author
Registered: 2005-07-03
Posts: 109

Re: glz_custom_fields

wet wrote:

The latter.

Really? Wow. I noticed a lot of plugins relied on JavaScript, but I thought that the core backend worked pretty well without it.

Offline

#738 2010-09-17 10:36:17

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

Re: glz_custom_fields

johnstephens wrote:

There is also a very useful plugin that can be used alongside glz_cf for the same effect, and no hacks. I love it!

Thanks!

cain-mi wrote:

I just couldn’t get it to work though, I assumed it hadn’t been updated to work with the latest glz_cf.

Try to change le plugin load order (after glz_custom) . It works for me.

Also, I think it relies on JS (?).

Yes, it relies on js (jquery) but – as wet says – the whole admin side relies on JS

Offline

#739 2010-09-17 14:02:04

feragnoli
Member
From: the hague
Registered: 2005-02-10
Posts: 150

Re: glz_custom_fields

hello again,
is it anyhow possible to have different custom fields pointing to the same script?
what happens now, of course, is that php runs into an error of redaclaration of the function contained in the script.

Fatal error: Cannot redeclare videofolders_article() (previously declared in /www/htdocs/denhaag/cpm/scripts/glz_custom_fields/videoFolders_article.php:80) in /www/htdocs/denhaag/cpm/scripts/glz_custom_fields/videoFolders_article.php on line 112

?


what was that again…?

Offline

#740 2010-09-19 04:44:02

radneck
Plugin Author
Registered: 2005-07-03
Posts: 109

Re: glz_custom_fields

redbot wrote:

Try to change le plugin load order (after glz_custom) . It works for me.

Got it working, though I don’t think the load order had to do with it, just my ignorance ;)
I had a quick look through the JS it outputs on the Write page, and noted it looked for a label with a particular value in the for attribute. glz_custom_fields uses for="custom-1" rather than for="whatYouNamedYourCustomField" which is where I was stuck.

Thanks all for your tips.

Offline

Board footer

Powered by FluxBB