I am trying to upgrade my existing View code to Toolset block, this the condition that I had in a View:
[wpv-conditional if="( '[can_user_see_unreleased_content]' eq 'yes' OR '[types field='release-date' output='raw'][/types]' <= '[now_time_toolset]')"]
Now with the conditional block I can only do that on the visual editor, check the image capture attached to that message. So I can't tell my Date field to display in raw format which is something that I find missing, then I tried to changed it to the advanced editor, and I copied the conditional that was working but it doesn't want to accept it:
( ( '[can_user_see_unreleased_content ]' = 'yes' ) OR ( '[types field='release-date' output='raw'][/types]' <= '[now_time_toolset ]' ) )
It says: Please, complete all the conditions or remove them.
So how am I suppose to do it ?
And when you want to use that:
<a class="interview-one-name" href="[wpv-post-url item="@person-1min-interview.parent"]">[wpv-post-title item="@person-1min-interview.parent"]</a>
How do you do it with Toolset Blocks?
And when you have a code with that much conditional is it really worth trying to use Toolset Block ?
I'm trying to see if there would be any benefits for that or if I should separate the code in different part and use Fields and Text for exemple because it doesn't work and if I use the HTML block it doesn't work either.
Well, I guess, it's a general question on how do build a "complex" layout with a lot of conditions with your new system and if it was thought to handle that can of stuff. Is it better to stick with the old View stuff ?
[wpv-conditional if="('[types field='type-of-content' output='raw'][/types]' ne 'meditation-video' )"]
<section class="row interview-one-section">
<div class="col-sm-12 ">
<h1>Peace media library</h1>
<p>| <a href="<em><u>hidden link</u></em>">All content</a> | <a href="<em><u>hidden link</u></em>">Cast</a> | </p>
</div>
<div class="col-sm-12 interview-one-top">
<h2 class="interview-one-title"><i class="fad fa-microphone-alt" style=""></i> [wpv-post-title] </h2> - <a class="interview-one-name" href="[wpv-post-url item="@person-1min-interview.parent"]">[wpv-post-title item="@person-1min-interview.parent"]</a>
</div>
<aside class="col-sm-8">
[wpv-conditional if="( '[can_user_see_unreleased_content]' eq 'yes' OR '[types field='release-date' output='raw'][/types]' <= '[now_time_toolset]')"]
<div class="embed-responsive embed-responsive-1by1">
<iframe src="<em><u>hidden link</u></em> field='vimeo-url' output='raw' ][/types]?color&autopause=0&loop=0&muted=0&title=0&portrait=0&byline=0#t="></iframe>
</div>
<p class="interview-one-fa-video"><i class="far fa-info-circle"></i> You can turn on the subtitles by pressing the "CC" button on the video player</p>
[wpv-conditional if="( NOT(empty($(wpcf-transcript))) )"]
<div class="d-none d-md-block interview-transcript">
<h5 class="interview-one-transcript">Transcript</h5>
<p>[types field='transcript'][/types]</p>
</div>
[/wpv-conditional]
[/wpv-conditional]
[wpv-conditional if="( ('[types field='release-date' output='raw'][/types]' > '[now_time_toolset]'
OR $(wpcf-release-date) eq '')
AND '[can_user_see_unreleased_content]' ne 'yes' "]
<a href="[wpv-post-url]">[wpv-post-featured-image size="large" class="img-fluid"]</a>
[wpv-conditional if="( NOT(empty($(wpcf-release-date))) )"]
<p>You will be able to watch it on </p>
<span class="interview-one-many-content"><i class="far fa-calendar-check interview-fa-video" style=""></i> [types field='release-date' style='text' format='F j, Y'][/types]</span>
[/wpv-conditional]
[/wpv-conditional]
</aside>
<div class="col-sm-4 interview-one-col2">
[wpv-conditional if="( NOT(empty($(wpcf-release-date))) )"]
<p class="interview-one-many-content"><i class="far fa-calendar-check interview-fa-video" style=""></i> [types field='release-date' style='text' format='F j, Y'][/types]</p>
[/wpv-conditional]
[wpv-conditional if="( empty($(wpcf-release-date)))"]
<p class="interview-one-many-content"><i class="far fa-calendar-check interview-fa-video" style=""></i> Release date not yet known</p>
[/wpv-conditional]
[wpv-conditional if="( '[types field='release-date' output='raw'][/types]' > '[now_time_toolset]' OR $(wpcf-release-date) eq '' )"] <p class="interview-one-not-released">This interview has not been released yet.
[wpv-conditional if="( '[can_user_see_unreleased_content]' eq 'yes')"]
<span class="interview-one-not-released-yet-ok">(But you have the rights to watch it ;-) )</span>
[/wpv-conditional]
</p>
[/wpv-conditional]
[wpv-conditional if="( NOT(empty($(wpcf-video-quote))) )"]
<blockquote class="blockquote text-center interview-one-video-quote"><i class="fad fa-lightbulb-on"></i> <br>
[types field='video-quote' output='raw'][/types]
</blockquote>
[/wpv-conditional]
[wpv-conditional if="('[wpv-post-taxonomy type='interview-theme' format='slug' ]' ne '' )"]
<p class="text-center interview-one-taxonomies">[wpv-post-taxonomy type="interview-theme" separator=" - " ]</p>
[/wpv-conditional]
[wpv_nbr_child_post parent_post_id="[wpv-post-id item='@person-1min-interview.parent']" what_content='interview']
[wpv-conditional if="('[wpv_nbr_child_post parent_post_id='[wpv-post-id item='@person-1min-interview.parent']' what_content='interview']' gt '1' )" debug="true"]
<h5 class="interview-one-more-video-person"><i class="fad fa-users"></i> More videos from [wpv-post-title item="@person-1min-interview.parent"]</h5>
[wpv-view name="all-interviews-of-one-person-simple-text-display" wpvrelatedto="[wpv-post-id item="@person-1min-interview.parent"]" ids="[wpv-post-id]"]
[/wpv-conditional]
[wpv-conditional if="('[types field='connected-to-other-video' output='raw'][/types]' ne '' )"]
<h5 class="interview-one-meditative"><i class="far fa-eye"></i> Meditative short film</h5>
[wpv-view name="related-short-video-or-interview" ids="[types field='connected-to-other-video' output='raw'][/types]"]
<p><a href="[types field='website' output='raw'][/types]/peace-media-library/?wpv-wpcf-type-of-content=meditation-video">Watch other short films</a></p>
[/wpv-conditional]
[wpv-conditional if="('[wpv-post-taxonomy type='interview-theme' format='slug' ]' ne '' )"]
<h5 class="interview-one-more-video-topic"><i class="fad fa-spinner-third"></i> Discover more content </h5>
[wpv-view name="interviews-on-same-subject-that-categories-exclude-one-person" wpvrelatedto="[wpv-post-id item="@person-1min-interview.parent"]" ids="[get_ids_child_interview parent_id=[wpv-post-id item="@person-1min-interview.parent"]]" wpvinterviewtheme="[wpv-post-taxonomy type="interview-theme" format="slug"]"]
[/wpv-conditional]
</div>
</section>
[/wpv-conditional]
[wpv-conditional if="('[types field='type-of-content' output='raw'][/types]' eq 'meditation-video' )"]
<section class="row interview-one-section">
<div class="col-sm-12 ">
<h1>Peace media library</h1>
<p>| <a href="<em><u>hidden link</u></em>">All content</a> | <a href="<em><u>hidden link</u></em>">Cast</a> | </p>
</div>
<div class="col-sm-12 interview-one-top">
<h2 class="interview-one-title"><i class="fad fa-eye" style=""></i> [wpv-post-title] </h2>
</div>
<aside class="col-sm-8">
<div class="embed-responsive embed-responsive-1by1">
<iframe src="<em><u>hidden link</u></em> field='vimeo-url' output='raw' ][/types]?color&autopause=0&loop=0&muted=0&title=0&portrait=0&byline=0#t="></iframe>
</div>
[wpv-conditional if="( NOT(empty($(wpcf-transcript))) )"]
<div class="d-none d-md-block interview-transcript">
<h5 class="interview-one-transcript">Transcript</h5>
<p>[types field='transcript'][/types]</p>
</div>
[/wpv-conditional]
</aside>
<div class="col-sm-4 interview-one-col2">
<a class="interview-one-name text-center" href="[wpv-post-url item="@person-1min-interview.parent"]">[wpv-post-title item="@person-1min-interview.parent"]</a>
[wpv-conditional if="( NOT(empty($(wpcf-video-quote))) )"]
<blockquote class="blockquote text-center interview-one-video-quote"><i class="fad fa-lightbulb-on"></i> <br>
[types field='video-quote' output='raw'][/types]
</blockquote>
[/wpv-conditional]
<p><a href="[types field='website' output='raw'][/types]/peace-media-library/?wpv-wpcf-type-of-content=meditation-video">Watch other short films</a></p>
[wpv-conditional if="('[types field='connected-to-other-video' output='raw'][/types]' ne '' )"]
<h5 class="interview-one-meditative">Inspired by this interview</h5>
[wpv-view name="related-short-video-or-interview" ids="[types field='connected-to-other-video' output='raw'][/types]"]
[/wpv-conditional]
[wpv-conditional if="('[wpv-post-taxonomy type='interview-theme' format='slug' ]' ne '' )"]
<p class="text-center interview-one-taxonomies">[wpv-post-taxonomy type="interview-theme" separator=" - " ]</p>
[/wpv-conditional]
[wpv-conditional if="('[get_nbr_child_interview parent_id=[wpv-post-id item="@person-1min-interview.parent"]]' ne '1' )"]
<h5 class="interview-one-more-video-person">Others videos from [wpv-post-title item="@person-1min-interview.parent"]</h5>
[wpv-view name="all-interviews-of-one-person-simple-text-display" wpvrelatedto="[wpv-post-id item="@person-1min-interview.parent"]" ids="[types field='connected-to-other-video' output='raw'][/types]"]
[/wpv-conditional]
[wpv-conditional if="('[wpv-post-taxonomy type='interview-theme' format='slug' ]' ne '' )"]
<h5 class="interview-one-more-video-topic"><i class="fad fa-spinner-third"></i> Discover more content</h5>
[wpv-view name="interviews-on-same-subject-that-categories-exclude-one-person" wpvrelatedto="[wpv-post-id item="@person-1min-interview.parent"]" ids="[get_ids_child_interview parent_id=[wpv-post-id item="@person-1min-interview.parent"]]" wpvinterviewtheme="[wpv-post-taxonomy type="interview-theme" format="slug"]"]
[/wpv-conditional]
</div>
</section>
[/wpv-conditional]
and if you want to add a Fontawesome icon before your Heading block, how do you do that ? Beside going to HTML ?
Hello,
Q1) [wpv-conditional] shortcodes...
I can see the problem you mentioned above, and I have escalated this issue to our 2nd tier supporters.
Currently, I suggest you try "Shortcodes Block", for example setup two shortcodes blocks, with below codes:
[wpv-conditional if="( '[can_user_see_unreleased_content]' eq 'yes' OR '[types field='release-date' output='raw'][/types]' <= '[now_time_toolset]')"]
And
Use above blocks to wrap other contents.
Q2) Parent post link ...
This should be possible within Blocks UI, for example, you can add a block: Toolset-> Single field, in right "Block" tab, choose the post type relationship and post title + your custom CSS class name.
However, there will be some manual works to migrate old Views shortcode to new Blocks, same as above, you can also try the HTML block or shortcodes block, just copy/paste the contents, the old Views shortcodes will be able to work too.
Q3) add a Fontawesome icon before your Heading block
There isn't such a feature within Toolset plugins, you might consider other plugins, for example:
https://wordpress.org/plugins/font-awesome/
You can try to add inline codes insider the heading block, see above link, section "USAGE"
Here is the errata link:
https://toolset.com/errata/cant-insert-a-conditional-block-using-the-advanced-editor/
Currently, the workaround is:
When you use Conditional block, avoid using the literal comparison operators like eq, ne and use the traditional operators like =,!=, <.
Hello,
This is fixed in the latest version of Toolset Blocks plugin 1.1.0, you can download it here:
https://toolset.com/account/downloads/
Please test it and feedback if the problem is fixed, thanks