Skip Navigation

[Resolved] Use Blocks editor to create view with alternating template for odd/even items

This support ticket is created 4 years, 3 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Our next available supporter will start replying to tickets in about 2.26 hours from now. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

Tagged: 

This topic contains 2 replies, has 2 voices.

Last updated by katieS 4 years, 3 months ago.

Assisted by: Shane.

Author
Posts
#1759091

I recently had help to put a different template in the first item of a view using a conditional block and Current index in the views loop = 1
This worked well but now I need to be able to use alternating content templates for odd and even items in the view. Is there a way of using a condition to do this please?

Is there any documentation that you are following?

Is there a similar example that we can see?

What is the link to your site?

#1759249

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Katie,

Thank you for getting in touch.

For the Blocks setup you are not able to achieve an odd/even loop with the blocks plugin. You will need to do this using our Views plugin and edit your view's content template with the block editor.

However creating a view directly in Blocks won't allow you to make use of the odd and even option.
https://toolset.com/documentation/programmer-reference/views/views-shortcodes/#wpv-item

Thanks,
Shane

#1759385

Sadly, I thought that might be the case. I have been working hard over my last 3 sites to get used to using Blocks instead of Layouts and Views and have been impressed by a lot of things that are better.
I look forward to having more control over the Views from the Block in the near future I hope.
Thank you for your response