Passer la navigation

[Résolu] Types is creating a double URL when I insert the URL of a file attachment field

This support ticket is created Il y a 2 years, 11 months. 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
- 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 -

Fuseau horaire du supporter : Asia/Kolkata (GMT+05:30)

Ce sujet contient 6 réponses, a 2 voix.

Dernière mise à jour par Ian Henderson Il y a 2 years, 11 months.

Assisté par: Minesh.

Auteur
Publications
#2616393

On this site lien caché there is a button to download the attached PDF, but the URL of the file is duplicated (and thus a broken link). In the back end it is only showing once.

#2616411

Minesh
Supporter

Les langues: Anglais (English )

Fuseau horaire: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

Elementor does not offer what to display as by default with the URL field it will display the link.

So I suggest you should remove the elementor button you added and replace that with the following code. Add the following code to shortcode module or text module whatever module you desire will be the best fit for this:

<div class="elementor-element elementor-element-cd6a0df elementor-widget elementor-widget-button" data-id="cd6a0df" data-element_type="widget" data-widget_type="button.default">
				<div class="elementor-widget-container">
					<div class="elementor-button-wrapper">
			<em><u>lien caché</u></em>
		</div>
				</div>
				</div>

As you can see we have added the "href" attribute value with the types shortcode:

[types field='pdf-attachment' output='raw'][/types]
#2616427

Hi Minesh - I don't think Elementor is the issue. I have done this many times without a problem.

If I add a shortcode in the Types Content Template to display the raw URL of the link [types field='pdf-attachment' output='raw'][/types] in text in the front end, it's displaying a double URL. however, if I look at the post in the back end the field is showing a single URL correctly.

#2616437

Please see here lien caché - I've added the shortcode to display the raw URL

#2616439

Actually - I think the issue is nothing to do with Toolset, and may be an error on migration from Wagtail. On closer inspection the URL field has the same URL appended twice but the first one has '-1' at the end of the file name. I'll keep this open while we investigate.

#2616443

Minesh
Supporter

Les langues: Anglais (English )

Fuseau horaire: Asia/Kolkata (GMT+05:30)

Ok for sure.

#2616607

My issue is resolved now. Thank you!