Skip Navigation

[Resolved] Trim out all the space from the first and last options in custom search

This support ticket is created 5 years, 6 months ago. 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 – 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 replies, has 2 voices.

Last updated by Luo Yang 5 years, 6 months ago.

Assisted by: Luo Yang.

Author
Posts
#1322835
Screenshot 2019-08-23 at 4.42.56 PM.png

Dear Sir/Madam,

I have a custom search

  	<div class="form-group">
		[wpv-control-postmeta field="wpcf-estate" type="select" source="custom" url_param="wpv-wpcf-estate" values="[wpv-view name="options-estate-key"]" display_values="[wpv-view name="options-estate"]" default_label="請選擇屋苑"]
	</div>

wpv-view of options-estate

	<!-- wpv-loop-start -->
		<wpv-loop>[wpv-item index=1][wpv-post-title][wpv-item index=other],[wpv-post-title]</wpv-loop>
	<!-- wpv-loop-end -->

wpv-view of options-estate-key

	<!-- wpv-loop-start -->
		<wpv-loop>[wpv-item index=1][wpv-post-slug][wpv-item index=other],[wpv-post-slug]</wpv-loop>
	<!-- wpv-loop-end -->

I create both the options-estate and options-estate-key because I need a CRED form for the user to update the estate list, don't know why only the first and the last options contain a lot of space after the View rendering. What is the problem?

Best regards,

Kelvin.

#1322885

Dear Kelvin,

As your request:
https://toolset.com/forums/topic/getting-url-parameter-as-default-value-in-custom-search/#post-1322883

I have taken this ticket, please share your website credentials, then update this thread.

#1324001

I have done below modifications in your website:
Edit the post view "Options - Estate Key":
hidden link
in section "Loop Editor":
1) Wrap all codes into shortcode:
[wpv-noautop] ... [/wpv-noautop]

This will be able to remove line breaks

2) change line 1~6 to:

[wpv-noautop][wpv-layout-start]
[wpv-items-found]
<!-- wpv-loop-start -->
<wpv-loop>[wpv-item index=1][wpv-post-slug][wpv-item index=other],[wpv-post-slug]</wpv-loop>
<!-- wpv-loop-end -->
[/wpv-items-found]

Remove all space of each line.

Test it in front-end:
hidden link

It works fine, please check if it is what you want, thanks