Jump to content

This topic is 7516 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

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.

Posted

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

Posted

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

Posted

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

Posted

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

Posted

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

Posted

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.

This topic is 7516 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

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