Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#16 2016-12-05 15:59:27

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

Re: Comparisons in custom_field matching in article(_custom)?

Bloke wrote #303175:

Does that help?

That seems to be good, even if I don’t yet understand it 100%. I will see it in the future…

Offline

#17 2016-12-06 16:02:31

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

Re: Comparisons in custom_field matching in article(_custom)?

Bloke wrote #303161:

I like this. It should also be backwards compatible, because both month and time have been mutually exclusive so far.

I’ve tried to make it as bw compatible as possible, please test. Now we can output the upcoming articles with something like

<txp:article_custom month="now" time="+1 month" />

Anything that relates to global attributes, etc will be supported by virtue of them being processed as regular tag attributes. Not sure how it affects this use case, but since each custom field has a type and one such type is ‘date’, well, we could conceivably use the same mechanism for such attributes.

I guess it will be not before 4.8. And I would also consider a separator for custom fields that can carry multiple values (like Keywords, say).

Offline

#18 2021-06-25 08:42:30

demoncleaner
Plugin Author
From: Germany
Registered: 2008-06-29
Posts: 228
Website

Re: Comparisons in custom_field matching in article(_custom)?

I stumbled over this old post. I would need exactly that. Is there a way already by testing in article_custom the customfield= against multiple different values?

Actually what I need is more somthing like a wildcard.

I am wondering why this works:

customfield='_%'

and this works

customfield='<txp:if_variable name="test" value="">0<txp:else/>1</txp:if_variable>'

but that does not work

customfield='<txp:if_variable name="test" value="">_%<txp:else/>1</txp:if_variable>'

EDIT: Just realized putting the if_variable outside of the article_custom make it work fine. Still a bit weird.

Last edited by demoncleaner (2021-06-25 09:07:22)

Offline

#19 2021-06-25 09:46:36

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

Re: Comparisons in custom_field matching in article(_custom)?

demoncleaner wrote #330672:

Is there a way already by testing in article_custom the customfield= against multiple different values?

Partially, if the values come from an URL variable: match="customfield" on ?customfield[]=one&customfield[]=two page.

but that does not work

customfield='<txp:if_variable name="test" value="">_%<txp:else/>1</txp:if_variable>'...

This works for me, the problem must be elsewhere.

Offline

#20 2021-06-25 20:35:24

demoncleaner
Plugin Author
From: Germany
Registered: 2008-06-29
Posts: 228
Website

Re: Comparisons in custom_field matching in article(_custom)?

Ah ok thanks.
Yes indeed my whole setup was a bit more complex and the reason why it was not working came from elsewhere. But your comment helped me.

Offline

Board footer

Powered by FluxBB