ACF date comparison and complex logic conditions

Hi,

I’m trying to migrate from CCS to L&L plugin. I can manage simple templates so far but I am quite lost with this one :

[if field=dgr_dossier_date value='future not today']
<div>
[pass user_field=email]
  [-if field=dgr_dossier_user contains='{USER_FIELD}' empty=false]
    do something
  [-else]
    do something
  [/-if]
[/pass]
</div>
[else]
    do something
[/if]

Can you help me translating it in L&L syntax please ?
Note : Custom fields are created with ACF

Thanks a lot !
Regards

Hi, any solution here ? Thanks !

Hi Guillaume,
Sorry for the wait, your template is a bit daunting :sweat_smile:

Date conditionals are almost ready for release! Your outer date logic will be difficult to replicate until then. I’ve gotten around this issue on some projects by formatting dates as YmdHi to turn them into integers and then using less_than or greater_than to test if they’re past or future relative to today but it’s very unwieldy so it’s worth waiting for the dedicated logic :grimacing:

As for the rest of your template:

<Loop type=user id=current>
  <div>
    <If field=dgr_dossier_user compare=includes value='{Field email}'>
      do something
    <Else />
      do something
    </If>
  </div>
</Loop>

Here’s the documentation for our If tag and our User Loop.
I’ll follow up once the date conditional is released. I expect it will be soon!

1 Like

Hi Guillaume,

In a recent update, there’s a new feature for date conditionals.

It’s documented here: Date conditionals | Tangible Loops & Logic

The following CCS shortcode:

[if field=dgr_dossier_date value='future not today']

Can be expressed in L&L as:

<If acf_date=dgr_dossier_date after="today">

Depending on what ACF field type you’re using, it can be acf_date or acf_date_time.

1 Like

Marvelous ! Thanks a lot, best team ever :smiley:

1 Like