Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

using FindValueItem in CDML If statements...

Featured Replies

Does it work if you have something like...

[FMP-If: FindValueItem .eq. something]

Or...

[FMP-If: FindFieldItem .eq. something]

As there are some CDML replacement tags that are [FMP-FindValueItem] and [FMP-FindValueItem]

Basically I'm trying do an if on the results page of the search, to detect what fields people searched on by seeing if they contained a value.

Do I need to use the intratag replacement syntax for this?

So it looks something like...

[FMP-ElseIf: {FMP-FindFieldItem} .eq.]

??

What I've got so far is...

[FMP-CurrentFind]

[FMP-If: {FMP-FindFieldItem} .eq. XHTML]

<!-- DO NOTHING FOR THE XHTML FIND REQUEST -->

[FMP-ElseIf: {FMP-FindValueItem} .eq.]

<!-- DO NOTHING AS [FMP-FindFieldItem] IS EMPTY -->

[FMP-ElseIf: {FMP-FindValueItem} .neq.]

No newsletters could be found containing '[FMP-FindValueItem]'<br />

[/FMP-If]

[/FMP-CurrentFind]

To basically loop through all the fields that were part of the find request, ignoring the XHTML field as that's a hidden field that I don't want displayed.

ElseIf the user didn't type anything in that input box then don't do anything, ElseIf the user did type something in then show 'No newsletters could be found containing...'

Any ideas of where I'm going wrong?

I think the intratag replacement syntax can only be used on the right hand side of the operator in an If statement - but I can't remember.

I've also tried removing the FMP- from the intratags.

Any ideas of how to accomplish this one?

Thanks in advance.

You need to use loops for either the ValueList or the FindFieldItem. For example:

[FMP-ValueList: xyz]

[FMP-If: ValueListItem .eq. abc]

kpkpokpo

[/FMP-If]

[/FMP-ValueList]

or

[FMP-CurrentFind]

[FMP-If: {FindFieldItem} .eq. abc]

joioio

[/FMP-If]

[/FMP-CurrentFind]

I've never tried "{FindFieldItem}", however it is worth a go.

I don't think that you will be able to nest the loops. However give it a go.

Good Luck.

Garry

  • Author

Yeah I tried that as well, but I think that {FindValueItem} and {FindFieldItem} aren't valid intratags anyway - I think there are only certain CDML replacement tags that can be used as intratags.

Also according to the CDML Reference, it appears you can only use the intratag replacement syntax on the right hand side of an if statement - not on the left.

Although the CDML reference database is thin on the ground when it comes to explaining intratags - and only really uses them to talk about the {CurrentToken} intratag.

Anyone else know any more about intratags, or how to solve this problem?

This isn't a critical problem but it would be nice to be able to do.

Any ideas?

Thanks

Have you tried them without the "FMP-"?

[FMP-If: {FindFieldItem}.eq.XHTML]

Good Luck.

Garry

Howdy.

They also show intratags being used in INLINE ACTIONS (but I suspect there may be mistakes there as I remember having trouble with intratags in inlines and reading someone else's claim that the CDML reference is wrong wrt to intratags and inlines... it has been wrong on other things, too).

I think I've read posts about storing search criteria in tokens. If you decide to go with that approach instead, you could compare token values for checking what someone used for the search. That's probably easier, although I have never done it. Plus, [FMP-FindValueItem] and [FMP-FindFieldItem] look like they'd only work for 1 search field. What if there were 2 fields used for the search? Do they somehow show both values? Doubtful.

--ST

  • Author

Yep. Tried that.

No luck.

I think first of all intratags don't work on that side of the logical operator in an if statement, and it FindFieldItem may not even work as an intratag.

Thanks for your help

Hi, almost all of the tags work OK, like

[FMP-IF: CurrentFoundCount.eq.0]

There are no accounts needing attention.

[FMP-ELSE]

These accounts need to be activated:

[/FMP-IF]

.. but the "FindValuItem" tag needs to be contained within

[FMP-CURRENTFIND]

[/FMP-CURRENTFIND]

to be processed and I can't see a way of combining that with the "If" statement.

...........time for php.................

regards, jeff

If you will look at your copy of the CDMLRdb ([FMP-If]) you will notice the First Parameter is the Left Side of the Operator, and that usable parameters are then listed.

While the [FMP-CURRENTFIND] is not one of them, you might try using the mentioned Field parameter:

[FMP-If: drop_down_field .eq. abc]

This text.

[FMP-Else]

This other text.

It may or may not work for your needs.

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.