Skip Navigation

[Gelöst] Template in view for first item

This support ticket is created vor 3 Jahren, 1 Monat. 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.

Heute stehen keine Supporter zur Arbeit im Werkzeugsatz-Forum zur Verfügung. Sie können gern Tickets erstellen, die wir bearbeiten werden, sobald wir online sind. Vielen Dank für Ihr Verständnis.

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/Karachi (GMT+05:00)

Dieses Thema enthält 2 Antworten, hat 2 Stimmen.

Zuletzt aktualisiert von David Gimenez vor 3 Jahren, 1 Monat.

Assistiert von: Waqar.

Author
Artikel
#2198379

Hello.

I want to get diferent template for the view in a loop like this

[wpv-layout-start]
	[wpv-items-found]
	<!-- wpv-loop-start -->
	<wpv-loop wrap="1" pad="true">
		[wpv-item index=1]
		<div class="row ">
			<div class="col-md-12">FIRST</div>
		</div>
		[wpv-item index=other]
			<div class="col-md-12">OTHER</div>
		[wpv-item index=pad]
			<div class="col-md-12"></div>
		[wpv-item index=pad-last]
			<div class="col-md-12"></div>
		</div>
	</wpv-loop>
	<!-- wpv-loop-end -->
	[/wpv-items-found]
	[wpv-no-items-found]
		<strong>[wpml-string context="wpv-views"]No items found[/wpml-string]</strong>
	[/wpv-no-items-found]
[wpv-layout-end]

I think this is right but always shows FIRST in the loop. How can I get different content for the other items items?

Thanks!

#2198633

Hi,

Thank you for contacting us and I'd be happy to assist.

When wrap="1" is used, it sets the index counter to '1', for every result in the loop.

The correct usage, in this case, would be:


[wpv-layout-start]
	[wpv-items-found]
	<!-- wpv-loop-start -->
	<wpv-loop>
		[wpv-item index=1]
		<div class="row ">
			<div class="col-md-12">
				First
			</div>
		</div>
		[wpv-item index=other]
		<div class="row ">
			<div class="col-md-12">
				Other
			</div>
		</div>
	</wpv-loop>
	<!-- wpv-loop-end -->
	[/wpv-items-found]
	[wpv-no-items-found]
		<strong>[wpml-string context="wpv-views"]No items found[/wpml-string]</strong>
	[/wpv-no-items-found]
[wpv-layout-end]

I hope this helps and please let me know if you need any further assistance around this.

regards,
Waqar

#2202805

My issue is resolved now. Thank you!