Skip Navigation

[Resuelto] Hide on last record using template for view

This support ticket is created hace 5 años, 2 meses. 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.

Hoy no hay técnicos de soporte disponibles en el foro Juego de herramientas. Siéntase libre de enviar sus tiques y les daremos trámite tan pronto como estemos disponibles en línea. Gracias por su comprensión.

Sun Mon Tue Wed Thu Fri Sat
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+00:00)

Etiquetado: ,

Este tema contiene 1 respuesta, tiene 2 mensajes.

Última actualización por Nigel hace 5 años, 2 meses.

Asistido por: Nigel.

Autor
Mensajes
#1334703

I am trying to: Hide the <hr> tag when the last record is reached.

Link to a page where the issue can be seen: enlace oculto Look in the Helpful Docs right sidebar for an example of the <hr> tag displaying after the last record.

Here is the html code in the template section of the edit view screen.
<div class="custom-cta">
<h5>[wpv-post-title output="sanitize"]</h5>
[types field='document-description'][/types]
<p>Click to Download</p>
<hr>
</div>

#1334769

Nigel
Supporter

Idiomas: Inglés (English ) Español (Español )

Zona horaria: Europe/London (GMT+00:00)

Hi Rene

When you use the Loop Wizard the markup generated for the loop output typically includes the wpv-item shortcode used to generate different output for different positions in the loop, but your case isn't specifically covered.

It is documented here: https://toolset.com/documentation/user-guides/views-shortcodes/#wpv-item

I've just noticed that the item=last attribute isn't listed, so let me forward that to the documentation team.

In any case, here is an example of the kind of thing you need:

		<wpv-loop>
			[wpv-item index=other]
				<div class="not-last">
                  <h3>[wpv-post-link]</h3>
                  <hr>
          		</div>
			[wpv-item index=last]
				<div class="last">
                  <h3>[wpv-post-link]</h3>
          		</div>
		</wpv-loop>

It shows how one thing is being output for the last item in the loop (with no hr tag) while another is being output for all others (with an hr tag).