Dear Sir/Madam,
Here is a relationship between Application 1-N Contestant, I have a post to add new contestant, as post has not yet be built the relationship so I can't get the parent id or the custom field directly.
I code a shortcode to get_post_meta() and pass it to conditional group to display related field
[cred_show_group if=" [get_presentation_mode id="[wpv-search-term param="parent_vwcm-application_id"]"] eq 'online' )" mode="fade-slide"]
[cred_field field='contestant-recording-url' force_type='field' class='form-control' output='bootstrap' placeholder="Only Youtube URL is allowed"]
[/cred_show_group]
I am sure shortcode [get_presentation_mode id="[wpv-search-term param="parent_vwcm-application_id"]"] can return the value either 'live' or 'online', I did add the shortcode to Toolset > Setting > Front-end Content > Functions inside conditional evaluations, could you please help to explain why it doesn't work?
Best regards,
Kelvin
Hi Kelvin,
The idea you have seems to be correct, but I am not sure if there is a syntax problem or not.
Please test the steps below:
1. Replace the shortcode with the real value and see if the conditional works ok? Maybe also add parenthesis around the condition.
[wpv-conditional if="( '[get_presentation_mode id="DIRECT VALUE"]' eq 'online' )"]
The value is online
[/wpv-conditional]
2. If it works see if you can add the shortcode without any attributes? Can you try that and see if it works, I feel like the "" quotes there for the shortcode cause the conflict as it closes the original if statement ". Maybe if you can use '' instead.
Thanks.