Passer la navigation

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

This support ticket is created Il y a 4 années et 10 mois. 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.

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 -

Fuseau horaire du supporter : America/Jamaica (GMT-05:00)

Marqué : 

Ce sujet contient 2 réponses, a 2 voix.

Dernière mise à jour par katieS Il y a 4 années et 10 mois.

Assisté par: Shane.

Auteur
Publications
#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

Les langues: Anglais (English )

Fuseau horaire: 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