Skip Navigation

[Resolved] Output text if more than one textfield in repeatable groep

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
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10: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/Kolkata (GMT+05:30)

This topic contains 4 replies, has 1 voice.

Last updated by arnoldd 3 days, 9 hours ago.

Assisted by: Minesh.

Author
Posts
#2870990

Hello,

I have a "Post Field Group" with a "Repeatable group" in this group is multiple fields but one called "woonplaats"

I have a View that displays this single line field "woonplaats"

But if i use the reapeatable group and i make more then one value's:

-- Can i than output just a custom text: "there are more locations"

Instead of outputting al the "woonplaats"

#2871065

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

Yes - you can obviouisly do that.

Just to ensure we are on same page - you want to display some custom text if repeating field group has more than one items available - is that correct? if yes:

Can you please share problem URL where you want to display this custom text as well as admin access details and let me review your current setup and guide you in the right direction.

*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.

I have set the next reply to private which means only you and I have access to it.

#2871087

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

When you have more that 2x items with the repeating field group - do you want to display the first item or you just want to display custom message "more than one woonplaats" when you have more than one repeating field group item?

#2871091

When more than one: dispay text message.

#2871097

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

With your view:
=> hidden link

I've adjusted the "Loop Editor" section code as given under:

[wpv-layout-start]
	[wpv-items-found]
	<!-- wpv-loop-start -->
		[wpv-conditional if="( '[wpv-found-count]' gte '2' )"]
      			more than one woonplaats
      	[/wpv-conditional]
	<wpv-loop>
      	   
      			[wpv-conditional if="( '[wpv-found-count]' eq '1' )"]
      				[wpv-post-body view_template="loop-item-in-grid-veld-woonplaats"]
      			[/wpv-conditional]
				     
	</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]

Can you please confirm it works as expected.

#2871118

Great, thats it. Thank you very much!