Skip Navigation

[Resolved] Split: Icons not showing properly with AJAX

This support ticket is created 2 years, 2 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/Karachi (GMT+05:00)

Author
Posts
#2465607

hi Waqar,

many thanks.

I have another question concerning this archive view, should I open a new ticket or can we treat this issue here?
I use the plugin 'wp external link' in order to add an icon to external links. This works fine all over the website, it works also for this archive view, if the search setting is on 'page refresh, when user changes any filter settings and hits the search button'. But I would like to use simple AJAX search setting (page is actualized without page reload). Using this setting, the external link icons disappear .... no idea why? Is that also a question of JS Script?

The same behaviour can be observed in 'normal' views on our website containing this table of legal documents.

Can you recommand something?

Kind regards

Franz

#2465613

Hi Franz,

Can you please share some example links where the icons are not showing properly, with AJAX?

I'll be able to suggest the next steps, accordingly.

regards,
Waqar

#2465705
View with Icons.png
Search settings with page refresh.png
View no Icons.png
Search settings with AJAX.png

hello Waqar,

thanks for splitting the ticket.

If the search settings of the archive view are selected as displayed in the image 'Search settings with AJAX' (search without using search button and without page reload), then the icons at external links are not displayed (image 'View no Icons'). When I select the search settings in the archive view as displayed in image 'Search settings with page refresh' (search using the search button and reload of page), then, the icons are visible (image 'View with Icons).

I would like to use the setting 'search without using search button and no page reload', because this way is more convenient for useres and faster. How can I then make visible the icons in this case?

Kind regards

Franz

#2466457

Thank you for sharing these details.

I've done some troubleshooting and it seems that the "WP External Links" plugin applies some custom filters to the content to inject the icon markup, which doesn't get included when the results are updated through the AJAX. If it was using the standard WordPress content filter for this processing, then this wouldn't be happening.

As a quick fix/workaround you can manually include the icon markup in your archive's code so that it is not dependent on the processing by the "WP External Links" plugin.

For example, this is the code that you have for the first column that shows the external link:


<td style="width:8%">
	<a href='[types field="srlink" output="raw"][/types]' target="_blank" rel="noopener">
		[types field='sr-nr'][/types]
	</a>
</td>

You can update it to:


<td style="width:8%">
	<a href='[types field="srlink" output="raw"][/types]' target="_blank" rel="noopener" data-wpel-link="external" class="wpel-icon-right">
		[types field='sr-nr'][/types]
		<i class="wpel-icon fa fa-external-link" aria-hidden="true"></i>
	</a>
</td>

I hope this helps.

#2466871

My issue is resolved now. Thank you!