Skip Navigation

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

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 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

This topic contains 6 replies, has 2 voices.

Last updated by Ian Henderson 10 months, 2 weeks ago.

Assisted by: Minesh.

Author
Posts
#2616393

On this site hidden link 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

Languages: English (English )

Timezone: 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">
			<a href="[types field='pdf-attachment' output='raw'][/types]" target="_blank" output="raw" class="elementor-button-link elementor-button elementor-size-sm" role="button">
						<span class="elementor-button-content-wrapper">
						<span class="elementor-button-text">Download</span>
		</span>
					</a>
		</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 hidden link - 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

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Ok for sure.

#2616607

My issue is resolved now. Thank you!

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