Hello,
Trying to add fields inside options and other fields.
I think I have understood it correctly that you don't support if / else, but only if. For me this looks very correct. For both the options and field type.
<p>
[types field="solgt" option="1" state="checked"]<strong>Solgt</strong>[/types]<br />
[types field="solgt" option="1" state="unchecked"]<br />
kr. [types field='pris'][/types],-<br />
[types field='kommentar-til-pris'][/types]<br />
[/types]
</p>
However, the browser outputs the following:
<p>
<br>
<br>
kr. (here comes the field 'pris'),-<br>
here comes the field 'kommentar-til-pris')<br>
[/types]
</p>
Yes, [/types] is being displayed on the site.
I am also trying to add if fields, but this outputs nothing.
<p>
[wpv-if field="storrelse-motiv" evaluate="!empty($field)"]<br />
Motiv: [types field='storrelse-motiv'][/types]<br />
[/wpv-if]
</p>
<p>[wpv-if field="storrelse-ramme" evaluate="!empty($field)"]<br />
Ramme: [types field='storrelse-ramme'][/types]<br />
[/wpv-if]
</p>
Any solutions?
Looking forward to hear from you again,
Sample: hidden link
Hello,
[wpv-if] shortcode is outdated and replaced with [wpv-conditional] shortcode to display conditional output.
Please take a look at Views conditional output Doc: https://toolset.com/documentation/user-guides/conditional-html-output-in-views/
In your case you can use this snippet:
[wpv-conditional if="$(wpcf-solgt) eq 'checked'"]
What will be done if the expression is true
[/wpv-conditional]
Thank you,
Checked / unchecked did not work using the wpv-conditional, so I used 1 instead. However, if it's not checked, nothing happens. I put eq 0, meaning if it was not checked, it should print that instead. Am I right?
<p>
[wpv-conditional if="$(wpcf-solgt) eq '1'"]
<strong>Solgt</strong><br />
[/wpv-conditional]<br />
[wpv-conditional if="$(wpcf-solgt) eq '0'"]<br />
kr. [types field='pris'][/types],-<br />
[types field='kommentar-til-pris'][/types]<br />
[/wpv-conditional]
</p>
Also tried the following
<p>[wpv-conditional if="( $(wpcf-solgt) eq 'checked'" evaluate="true"]
<strong>Solgt</strong><br />
[/wpv-conditional]<br />
But this did not work either.
Any ideas?
Also tried the following:
[wpv-conditional if="( $(wpcf-solgt) eq 'checked'" evaluate="true"]<strong>Solgt</strong><br />
[/wpv-conditional]
[wpv-conditional if="( $(wpcf-solgt) ne '' )"]
kr. [types field='pris'][/types],-<br />
[types field='kommentar-til-pris'][/types]<br />
[/wpv-conditional]
Solved by using the following:
[wpv-conditional if="$(wpcf-solgt) eq '1'"]
<strong>Solgt</strong><br />
[/wpv-conditional]
[wpv-conditional if="$(wpcf-solgt) eq '1'" evaluate="false"]
kr. [types field='pris'][/types],-<br />
[types field='kommentar-til-pris'][/types]<br />
[/wpv-conditional]
It's nice to hear, that you had solved your task.
Have a nice day!
Solved by using the following
[wpv-conditional if="$(wpcf-solgt) eq '1'"]
<strong>Solgt</strong><br />
[/wpv-conditional]
[wpv-conditional if="$(wpcf-solgt) eq '1'" evaluate="false"]
kr. [types field='pris'][/types],-<br />
[types field='kommentar-til-pris'][/types]<br />
[/wpv-conditional]