Kudos for a great module! Any plans for porting it to D8 yet?
If not I'd like to help.

-AjitS on IRC

Comments

AjitS created an issue. See original summary.

AjitS’s picture

Issue summary: View changes
feldmarv’s picture

Any news about this issue? Is a D8 port planned or is there a more nice way with Drupal 8?

j-vee’s picture

You can now use Twig inside Views and you can use that to create conditional view fields.

For example, I have a boolean field in my News item -content type that allows the users to highlight certain news items. I added that field to my view and then in the field's settings Rewrite Results -> Override the output of this field with custom text I added the following simple Twig code:

{% if field_highlight_news_item =='On' %}
highlight
{% else %}
no-highlight
{% endif %}

So now my view field prints out either highlight / no-highlight depending on what the user has selected for each news node.

Very simple and this Twig templating in Views should prove to be super useful!

joshi.rohit100’s picture

I have started the D8 port. Initial version can be found here - https://github.com/joshirohit100/views_conditional

anand.toshniwal93’s picture

Status: Active » Needs review

Hi all,

I have completed the porting of the module, here is code repo: https://github.com/anandtoshniwal93/views_conditional

This is a complete port to D8, please review. I would also like to maintain it in future :-)

purushotam.rai’s picture

Looks good to me. Nice work @anand.toshniwal93

anand.toshniwal93’s picture

Status: Needs review » Fixed
devad’s picture

Version: 7.x-1.x-dev » 8.x-1.x-dev

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.