Skip Navigation

[Résolu] How to add a running number in Views for RFGs?

Ce fil est résolu. Voici une description du problème et la solution proposée.

Problem:

I want to add a running number in my Views for each row in my RFG.

Solution:

You can try shortcode [wpv-loop-index].

Relevant Documentation:

https://toolset.com/documentation/programmer-reference/views/views-shortcodes/#wpv-loop-index

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

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

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

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

This topic contains 2 réponses, has 2 voix.

Last updated by StanleyT8485 Il y a 2 années et 7 mois.

Assisted by: Luo Yang.

Auteur
Publications
#2131909

Tell us what you are trying to do?

I want to add a running number in my Views for each row in my RFG. For example, if I have 10 rows in the RFG, each row would have a number 1 to 10. Row 1 = 1, Row 2 = 2, Row 3 = 3, Row 9 = 9, etc.

One idea that I came up with is to use [wpv-item index=1] and do it for each row but that wouldn't be efficient.

<wpv-loop>
[wpv-item index=1]
<tr>
<td>1. [types field="career-quiz-question"][/types]</td>
<td><input name="q1" type="radio" /></td>
<td><input name="q1" type="radio" /></td>
<td><input name="q1" type="radio" /></td>
</tr>
[wpv-item index=2]
<tr>
<td>2. [types field="career-quiz-question"][/types]</td>
<td><input name="q2" type="radio" /></td>
<td><input name="q2" type="radio" /></td>
<td><input name="q2" type="radio" /></td>
</tr>
[wpv-item index=3]
<tr>
<td>3 [types field="career-quiz-question"][/types]</td>
<td><input name="q3" type="radio" /></td>
<td><input name="q3" type="radio" /></td>
<td><input name="q3" type="radio" /></td>
</tr>
</wpv-loop>

Is there a more efficient way to handle this?

#2132209

Hello,

You can try shortcode [wpv-loop-index], see our document:
https://toolset.com/documentation/programmer-reference/views/views-shortcodes/#wpv-loop-index
This shortcode is used to display the current index in a View loop.

#2132323

My issue is resolved now. Thank you!

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.