Pro 6.7.4 - Ampersand not accepted in condition string via dynamic content

Hi,

When using dynamic content in an element condition string and that dynamic content returns a value containing an ampersand it is not accepting it.

Example use case for a post title called “Chalk & Cheese”.

This works:
Condition > String > Chalk & Cheese – in – {{dc:looper:field key=“somefield”}}

This does not work:
Condition > String > {{dc:post:title}} – in – {{dc:looper:field key=“somefield”}}

They should both provide the same outcome but I can only assume the ampersand is not being accepted as it has broken before.

The Preview dropdown also not showing the ampersand correctly.

Hello @boomfly,

Thanks for writing to us.

In order to help you with your concerns, we need to check your settings. I would request please share the admin login details meanwhile I would suggest you troubleshoot a few of the common issues before we investigate your settings. Please share your details in a secure note. Please provide the following details

  • WordPress Login URL
  • Admin-level username and password
  • Exact URL

You can find the Secure Note button at the bottom of your posts

Thanks

Hello @boomfly,

It seems that you have set the page with a parent. I would suggest you please set the page that has no parent, and then check it again.

Hope it helps
Thanks

Hi @prakash_s,

No I’m afraid you’ve misunderstood. You need to pick a page with an ampersand in the title as this is the issue. Please revisit the secure note and follow the instructions.

Thank you.

Hello @boomfly,

You’ll need to enter the exact page title as you originally saved it with the ampersand (&). When the page title is rendered with dynamic content, the browser automatically formats the ampersand, but for string comparison, it requires an exact match with the original text.

Thanks

Hi @prakash_s,

So you’re saying that encoded characters aren’t outputted through dynamic content in their rendered form? What if I want to use an & in a url query string like this example from earlier in the thread? That means dynamic content would output & when it’s not wanted. Are you 100% sure that’s how it is supposed to work?

Without going into a long explanation of how I’m using this but I’m basically comparing the post title with a value being pulled in from an external API which means I can’t input & like you suggested. It has to match an & with an &.

Thanks

Hello Chris,

Please take a look at this first:

  • See the screenshots in the secure note below

Take note that you have inserted Chalk & Cheese as the post title.

What I am trying to say is that whatever is the post title, that is what is being returned by the **{{dc:post:title}}**dynamic content. You cannot compare {{dc:post:title}} and {{dc:url:param key="name"} because they do not have the same process before returning any data.

Hope this helps.

Hi @ruenel

Thanks for your response. Sorry for the confusion, I was testing out adding the & in the title but it makes no difference. I’ve reverted to the & in the title but you can see from my screenshots that either way, the {{dc:post:title}} isn’t matching the condition with the & or & now. I’m totally confused why this isn’t working if you’re saying it should output the actual text in the post title not the encoded version.

Hi Chris,

I have investigated this and I am baffled why the & is not read by the condition. I am 100% sure that they are the same. I think I need to double check this with the developers.

In the meantime, to save us from time, I would suggest that you use {{dc:post:slug}} instead:

Best Regards.

Thanks for the update @ruenel, I just knew there wasn’t something quite right. Look forward to hearing your findings.

I have another workaround for my use case but thanks for your suggestion.

Hello @boomfly,

We will continue looking into this and share any findings once we have more clarity. Glad that you’ve found a workaround for your use case in the meantime.

Thanks