Textpattern CMS support forum

You are not logged in. Register | Login | Help

#71 2020-01-09 12:28:14

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

Re: glz_custom_fields v2 beta for Textpattern v4.7

Been there before, but can’t seem to find it back here:
How can i change the divider between values in a multiple choice custom field?

glz_custom_fields v2 beta displays | but i would like to display commas instead.

Thanx much!

Last edited by jayrope (2020-01-09 12:35:49)


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

Offline

#72 2020-01-09 13:09:15

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 3,657
Website

Re: glz_custom_fields v2 beta for Textpattern v4.7

jayrope wrote #320965:

How can i change the divider between values in a multiple choice custom field?

glz_custom_fields v2 beta displays | but i would like to display commas instead.

There was a reason for that, but I had to look it up again – see this thread. In short, you can’t change it in the plugin, but you can use either rah_replace to search/replace the | to a , or you can use rah_repeat where you can specify the delimiter you want to use when processing the list of items.


TXP Builders – finely-crafted code, design and txp

Offline

#73 2020-01-09 13:28:32

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

Re: glz_custom_fields v2 beta for Textpattern v4.7

jakob wrote #320966:

There was a reason for that, but I had to look it up again – see this thread. In short, you can’t change it in the plugin, but you can use either rah_replace to search/replace the | to a , or you can use rah_repeat where you can specify the delimiter you want to use when processing the list of items.

Yes! Jakob, Du rockst. Dicken Dank. That was the answer. I did it before, but couldn’t remember on which of the various sites. Now i just hope that all this will be much more unproblematic with TXP 4.8 …

Last edited by jayrope (2020-01-09 13:29:16)


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

Offline

#74 2020-01-09 13:32:55

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 3,657
Website

Re: glz_custom_fields v2 beta for Textpattern v4.7

Glad you found it. The unlimited custom fields is not in txp 4.8 core (but is in development in a separate branch) but txp 4.8 contains a lot more and is worth updating to when it comes out.

I’ll have to investigate the new plugin format where attached files can be included as part of the plugin. That could make sense for a txp-4.8-only version of this plugin to make installing easier.


TXP Builders – finely-crafted code, design and txp

Offline

#75 2020-01-09 13:48:20

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

Re: glz_custom_fields v2 beta for Textpattern v4.7

jakob wrote #320968:

Glad you found it. The unlimited custom fields is not in txp 4.8 core (but is in development in a separate branch) but txp 4.8 contains a lot more and is worth updating to when it comes out.

So i will just hope, that the current glz_custom_fields v2 beta will STILL work with TXP 4.8 … ui ui ui.


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

Offline

#76 2020-01-09 14:03:48

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

Re: glz_custom_fields v2 beta for Textpattern v4.7

While we’re at it:
Can anybody see a way to turn single values from multiple entry custom fields into individual search terms?
Just looking for a roadmap there.
Thank you!


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

Offline

#77 2020-01-09 14:14:14

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 3,657
Website

Re: glz_custom_fields v2 beta for Textpattern v4.7

Can you explain what you’re trying to achieve?

Two examples:

1. A list of search links with each selected value:

<txp:rah_repeat value='<txp:custom_field name="your-multi-cf" />' delimiter="|">
    <a href="https://example.com/?q=<txp:rah_repeat_value escape="url" />">
        Search for “<txp:rah_repeat_value />”
    </a>
</txp:rah_repeat>

or 2. a single search term comprised of all chosen values together:

<!-- construct the search term out of the chosen options -->
<txp:variable name="search_term" escape="trim">
<txp:rah_repeat value='<txp:custom_field name="your-multi-cf" />' delimiter="|" break="+" escape="trim">
    <txp:rah_repeat_value />
</txp:rah_repeat>
</txp:variable>
<!-- the search link -->
<a href="https://example.com/?q=<txp:variable name="search_term" escape="url" />">Search for <txp:variable name="search_term" /></a>
jayrope wrote #320971:

Just looking for a roadmap there.

The idea is that this plugin eventually disappears when more flexible custom fields hit the core. Ideally, at that point, you can migrate your glz_custom_fields to the core method and then remove the plugin altogether.

I will endeavour to ensure it keeps working until then to the best of my abilities but I don’t really want to add any functionality that will mean it is still needed after that.


TXP Builders – finely-crafted code, design and txp

Offline

Board footer

Powered by FluxBB