Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1117 2015-01-12 14:36:00

uli
Moderator
From: Cologne
Registered: 2006-08-15
Posts: 4,315

Re: glz_custom_fields

colak wrote #287292:

Do you call the fields in the same way as you do the normal custom fields

Yes. So your code for a cf would be <txp:custom_field name="type" default="-"/>


In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links

Offline

#1118 2015-01-12 15:00:09

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,169
Website GitHub Mastodon Twitter

Re: glz_custom_fields

thanks uli… I think that I just made them work:)


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#1119 2015-10-02 17:35:28

CeBe
Plugin Author
From: Caen - Fr
Registered: 2010-06-25
Posts: 345
Website

Re: glz_custom_fields

I have a problem with accented letters: for example, vidéo becomes vido (the é is dropped). I already tried to replace all occurrences of htmlspecialchars with txpspecialchars but the problem is still here and I can’t find the reason. Where should I look?

Last edited by CeBe (2015-10-02 17:35:44)

Offline

#1120 2015-10-02 18:58:10

uli
Moderator
From: Cologne
Registered: 2006-08-15
Posts: 4,315

Re: glz_custom_fields

Hi Claire, if possible with the website you’re working on, try disabling glz_cf temporarily, then go to the advanced preferences, the cfs are now displayed there, again, enter the correct term, save and reactivate glz. I tried the Franco-Allemand mixture “Vidéogröße”. It’s accepted and displayed on the admin side. Haven’t tried, though, whether it works and whether each possibility to use it is viable, I’ve been a good guy ;) and only worked with ASCII until now.

If problems arise, there’s also wet_babble bot_cf_titles to individualize custom field names (thanks, GugUser).

Edit: Just tried to edit the Vidéogröße field I entered without glz_cf, but now with glz_cf re-activated and – of course – glz_cf swallows all flourishes. So either edit field names as a last step or use the wet plugin from the start.

Last edited by uli (2015-10-03 14:26:28)


In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links

Offline

#1121 2015-10-02 19:26:36

uli
Moderator
From: Cologne
Registered: 2006-08-15
Posts: 4,315

Re: glz_custom_fields

I’ve found this here, might be more likely the thing you’re after, Claire:

// will leave only [A-Za-z0-9 ] in the string
function glz_clean_string($string) {
  if ($string)
    return preg_replace('/[^A-Za-z0-9\s\_\-]/', '', $string);
}

Edit: Yup, I just added ßöéà to the regex and I could save “Vidéogröße” and “Voilà” :)

Last edited by uli (2015-10-02 19:34:04)


In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links

Offline

#1122 2015-10-02 20:24:51

GugUser
Member
From: Quito (Ecuador)
Registered: 2007-12-16
Posts: 1,477

Re: glz_custom_fields

CeBe wrote #295341:

Where should I look?

I know, this is not an answer to your question, but I can confirm that I frequently use the glz custom fields for Spanish text parts like, for example, “González Suárez y Av. Oswaldo Guayasamín”, and never had any problems with it.

Letters like these are shown correctly: ñøÁèô.

Your problem is not a general problem. I know, this doesn’t help.

Maybe this:

Do you use Typekit with a disabled french language subsetting, or fonts without the required characters?

Offline

#1123 2015-10-02 20:27:58

CeBe
Plugin Author
From: Caen - Fr
Registered: 2010-06-25
Posts: 345
Website

Re: glz_custom_fields

uli wrote #295342:

try disabling glz_cf temporarily, then go to the advanced preferences, the cfs are now displayed there, again, enter the correct term, save and reactivate glz.

Woah!!! It works!
Note: this has to be done every time such a custom field is edited.

uli wrote #295345:

I’ve found this here, might be more likely the thing you’re after, Claire:

// will leave only [A-Za-z0-9 ] in the string...

Yup. Would be cleaner with a regexp to keep accents too.

A really big big thank you!

Offline

#1124 2015-10-02 20:28:16

GugUser
Member
From: Quito (Ecuador)
Registered: 2007-12-16
Posts: 1,477

Re: glz_custom_fields

Other idea: I beginn my .htaccess file with AddDefaultCharset utf-8.

Offline

#1125 2015-10-02 20:38:03

CeBe
Plugin Author
From: Caen - Fr
Registered: 2010-06-25
Posts: 345
Website

Re: glz_custom_fields

GugUser wrote #295348:

I frequently use the glz custom fields for Spanish text parts

Ok, I asked my question too rapidly, I’m sorry .
The accents were not kept for the names of the custom fields in admin side. The content is correct.

Offline

#1126 2015-10-02 20:53:28

GugUser
Member
From: Quito (Ecuador)
Registered: 2007-12-16
Posts: 1,477

Re: glz_custom_fields

Oh, but that’s another thing.

I quote from the documentation:

Important notes on creating custom field names:

Custom field names may include letters (uppercase or lowercase), numbers, and under scores, but no spaces or other special characters should be used. For example, custom1, Custom1, and Custom_1 are all valid name constructs, while custom 1 and custom ! are not.

Offline

#1127 2015-10-02 23:50:05

GugUser
Member
From: Quito (Ecuador)
Registered: 2007-12-16
Posts: 1,477

Re: glz_custom_fields

The bot_cf_titles plug-in maybe could be something for you, although it is no longer being developed.

Offline

#1128 2015-10-03 14:23:16

uli
Moderator
From: Cologne
Registered: 2006-08-15
Posts: 4,315

Re: glz_custom_fields

I did some quick tests with accented letters and umlauts in custom field names: article_custom doesn’t work, as expected (and I don’t expect the article tag to accept those characters, likewise). The (if) custom field tags do work, though. Hence, an amended regex should only be used if done with care, and better than hacking glz_cf is certainly using the plugin GugUser mentioned, bot_cf_title. That one is the right one, not wet_babble. BTW, I tested it and it’s still working. I’ll correct my wet_babble mention above.


In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links

Offline

Board footer

Powered by FluxBB