Skip Navigation

[Resolved] Custom view displays posts with empty spaces inbetween

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

This topic contains 3 replies, has 2 voices.

Last updated by Waqar 1 year, 11 months ago.

Assisted by: Waqar.

Author
Posts
#2351937

Tell us what you are trying to do?
I am trying to create a custom view that only displays posts that certain conditions apply to. However, the list of posts is not displayed one after the other, but if one post does not fulfill the conditions, it shows an empty space and I want to avoid that. Can you assist in this?

This is the URL: hidden link

Furthermore, I want to display buttons in toolset views in the same way as they do in native theme/elementor formats. Can you provide some help on this as well?

#2352049

Unfortunately, I also got the error message "Google maps cannot be loaded properly on this page. Check the javascript code."

Additionally, I cannot display anything when hovering over the map.

This is the code within the search part of the view in the backend: <div class="col-md-8">[wpv-map-render map_id="map-14"][/wpv-map-render]</div>

#2352323

Waqar
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Hi,

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

To guide you around these points, I'll need to see how this view is set up in the admin area.

Can you please share temporary admin login details, in reply to this message?

Note: Your next reply will be private and it is recommended to make a complete backup copy, before sharing the access details.

regards,
Waqar

#2353877

Waqar
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Thank you for sharing the admin access.

1. To avoid the spaces in the grid, due to the conditional display of the results, I updated the loop editor content of the view "Sort by distance". Instead of adding separate div containers with class "row" for each row in the grid, I wrapped all the results in a single div container with class "row":


[wpv-layout-start]
	[wpv-items-found]
		<div class="row ">
		<!-- wpv-loop-start -->
		<wpv-loop>
			<div class="col-md-4">[wpv-post-body view_template="loop-item-in-sort-by-distance"]</div>
		</wpv-loop>
		<!-- wpv-loop-end -->
		</div>
	[/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]

And in the same view's JS editor, I included this custom script, which hides any grid column divs with the class "col-md-4", that doesn't contain any result:


jQuery(document).ready(function( $ ) {
	$('.js-wpv-view-layout .row .col-md-4').each(function() {
		if($('.tb-container', this).length <= 0) {
			$(this).hide();
        }
	});
});

Note: You can see these changes in action on the page "Arzt- und Kliniksuche".

2. The button styles from the Elementor are dependent on certain HTML classes, which can't be assigned to the button added through the Toolset's button block.

A workaround is to use some custom JS code, to append those classes to the Toolset's button block output:


jQuery(document).ready(function( $ ) {
	$('div.tb-button').each(function() {
		$(this).addClass('elementor-kit-5');
      	$(this).children('a.tb-button__link').addClass('elementor-button');
	});
});

I've included this script in the view "Veranstaltungen_final" and its result can be seen on the page "Veranstaltungen".

3. Some of the styles from the Elementor are turning the text in the map markers white, which makes it invisible on the white background.

You can include the following code in the view's CSS editor, to change the color of the text inside the map markers, to make it properly visible:


.gm-style-iw.gm-style-iw-c {
color: #000000;
}

4. I couldn't see the error "Google maps cannot be loaded properly on this page. Check the javascript code." on the pages that you've mentioned. I'll recommend updating all the plugins and the active theme to the latest versions and then checking the page with Google Maps again.

In case the issue persists, you're welcome to start a new ticket, along with the details about the page where this error can be seen.

Note: As per our support policy, we encourage creating separate tickets for each separate question or concern.
( ref: https://toolset.com/toolset-support-policy/ )

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