Skip Navigation

[Resuelto] Need a view to output text for html data attribute without spaces…

This support ticket is created hace 3 años, 3 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
- 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)

Etiquetado: ,

Este tema contiene 2 respuestas, tiene 2 mensajes.

Última actualización por shawnW-3 hace 3 años, 3 meses.

Asistido por: Waqar.

Autor
Mensajes
#2152951

Tell us what you are trying to do?
I'm working on an application to filter products with jQuery. This will require a line like:

<div class="uk-width-1-6 uk-text-center dataelements" data-tags="[wpv-view name='product-title-and-related-product-types-product-guide-view']">

The view name in that code loops

[wpv-post-slug] [wpv-post-slug item="@product-product-type.parent"]

without out any html and with "Disable the wrapping DIV around the View" checked.

However it's returning:





	
	
	
		grills installation-accessories
	
	
	
	


With unwanted spaces/returns.

After thorough testing in my JS, I believe this is what's keeping the function from working properly. Could be wrong, but it's what everything is pointing to.

Is there a way to eliminate these spaces so that I'm just getting "grills installation-accessories"?

Is there any documentation that you are following?
I've looked, but it's a hard thing to search for specifically

Is there a similar example that we can see?
Not that I can think of outside of stating the intended result is, for example:

<div class="uk-width-1-6 uk-text-center dataelements" data-tags="grills installation-accessories">

What is the link to your site?
enlace oculto

#2153427

Hi,

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

I tried to view the page that you've shared, but it shows the "403 Forbidden" error.

To remove all the extra spaces and characters from the view's output, you can follow these steps:

1. From the view's "Output Editor", remove the shortcode "[wpv-filter-meta-html]".
( it will remove any content or spaces added in the "Search and Pagination" section )

2. In the view's "Loop Editor" make sure that no extra lines or line breaks are used and all the content is added in the same line, without spaces.

For example:


[wpv-layout-start][wpv-items-found]<!-- wpv-loop-start --><wpv-loop>[wpv-post-slug] [wpv-post-slug item="@product-product-type.parent"]</wpv-loop><!-- wpv-loop-end -->[/wpv-items-found][wpv-no-items-found][/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

#2153707

Brilliant! Should have thought of those two things! My issue is resolved now. Thank you!