Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1201 2018-02-25 21:01:14

jayrope
Plugin Author
From: Berlin
Registered: 2006-07-06
Posts: 687
Website Mastodon

Re: glz_custom_fields

When i use custom fields in glz_cf 1.5.0, which are set to accept multiple entries, then those show up in an article as

entry1|entry2|whateverelseentry|thelastentrymaybe|butmaybenot

how can i use a different separator than | – say i want to use commas to display between single entries?

unfortunately <txp:custom_field /> doesn’t have a break="" attribute…
and note, that sthg. like <txp:if_custom_field name="genre 1" separator=", "> doesn’t help either.

I suspect i have to edit glz_cf ?

Thanx much in advance!

Last edited by jayrope (2018-02-26 02:41:33)


A hole turned upside down is a dome, when there’s also gravity.

Offline

#1202 2018-02-26 08:39:56

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,578
Website

Re: glz_custom_fields

Yes, that’s how glz-cf stores multiple values. I think the reasoning was so that you could have values in your multiple values that contain commas. What you can do is to use rah_replace to turn it into a comma-delimited list or rah_repeat to process the list using the separator it has.

@all: BTW: A new version that’s compatible with v4.7 can now be found in this thread.


TXP Builders – finely-crafted code, design and txp

Offline

#1203 2018-02-26 08:49:58

phiw13
Plugin Author
From: Japan
Registered: 2004-02-27
Posts: 3,058
Website

Re: glz_custom_fields

jakob wrote #309435:

@all: BTW: A new version that’s compatible with v4.7 is in the works but not quite done yet.

yay!

(if you want to toss a beta my way, I’ll be happy to destroy test it)


Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern

Offline

#1204 2018-02-26 10:55:12

jayrope
Plugin Author
From: Berlin
Registered: 2006-07-06
Posts: 687
Website Mastodon

Re: glz_custom_fields

Thanx for the hint, Jakob. No idea why i never got to use this nifty little plug before.


A hole turned upside down is a dome, when there’s also gravity.

Offline

#1205 2018-02-26 16:42:05

jayrope
Plugin Author
From: Berlin
Registered: 2006-07-06
Posts: 687
Website Mastodon

Re: glz_custom_fields

By the way Jakob, i suppose you need to add
if (class_exists('\Textpattern\Tag\Registry')) { Txp::get('\Textpattern\Tag\Registry') ->register('rah_replace') ; }
to the plugin code to make that nasty tag error go away in debug mode. :)

Last edited by jayrope (2018-02-26 16:43:24)


A hole turned upside down is a dome, when there’s also gravity.

Offline

#1206 2018-02-27 17:16:55

jayrope
Plugin Author
From: Berlin
Registered: 2006-07-06
Posts: 687
Website Mastodon

Re: glz_custom_fields

I am wondering, how to extract the single entries from custom fields accepting multiple entries, to process them further, use them as search tags etc.

Could someone get me on the right path, maybe with an example script?

etc_search?

Thank you very much!


A hole turned upside down is a dome, when there’s also gravity.

Offline

#1207 2018-02-27 20:35:12

etc
Developer
Registered: 2010-11-11
Posts: 5,028
Website GitHub

Re: glz_custom_fields

A pull request is awaiting 4.8 to implement a finer multi-valued custom fields control. Atm, I would use etc_query for individual items extraction:

<txp:etc_query data="a|b|c" markup="list:|" query="1" />

will output the second item of data list (namely b=data[1]), the index starting with zero.

And yes, you should be able to use etc_search to, say, retrieve the articles sharing some values with a given list. Please provide an example of what you want if you need help.

Offline

#1208 2018-02-27 21:20:33

jayrope
Plugin Author
From: Berlin
Registered: 2006-07-06
Posts: 687
Website Mastodon

Re: glz_custom_fields

Thank you, etc, much appreciated.
I want to read multiple values from one custom field (which are delimited with a | ) in my case custom_25, split those values into a list of individually searchable values to find out, which other articles have that particular term in their custom_25 entries and compile those related articles into a list to look at.

Practical example
One article has
entry1|entry2|entry3 in custom_25
Now i want to find out, which other articles have entry3 also in their custom_25.

Thanx much for any hints. I haven’t etc_query installed (on txp 4.6.2) but smd_query 0.50, but no real mysql query experience….


A hole turned upside down is a dome, when there’s also gravity.

Offline

#1209 2018-04-26 13:14:57

jpdupont
Member
Registered: 2004-10-01
Posts: 752

Re: glz_custom_fields

jakob wrote #309435:

@all: BTW: A new version that’s compatible with v4.7 is in the works but not quite done yet.

Hello Jakob,

Is it possible to get this new version :-)) ?

Offline

#1210 2018-04-26 13:20:14

phiw13
Plugin Author
From: Japan
Registered: 2004-02-27
Posts: 3,058
Website

Re: glz_custom_fields

jpdupont wrote #311426:

Hello Jakob,

Is it possible to get this new version :-)) ?

Here


Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern

Offline

#1211 2018-04-26 15:32:11

jpdupont
Member
Registered: 2004-10-01
Posts: 752

Re: glz_custom_fields

Thanks !

Offline

#1212 2018-04-26 16:43:04

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,578
Website

Re: glz_custom_fields

Ah, thanks for pointing that out. I’ve updated my post to include the link.


TXP Builders – finely-crafted code, design and txp

Offline

Board footer

Powered by FluxBB