Problem with URLs in a module

Skip to first unread message

Simon Watson

Oct 31, 2021, 5:19:05 AM10/31/21
to Joomla! General Development
Hi there,

I hope you can help. I've written a simple module for my Joomla 3.x website to pull some data from an API and present that on the site. The URLs returned from the API link outside of my Joomla site and are provided as absolute links in the form "".

The code in the module reads:

span.innerHTML = `${date} ${time} - <a href="${url}" target="_blank">${event.title}</a>`;

But when it is rendered by Joomla a prepended / appears at the start of the href:

span.innerHTML = `${date} ${time} - <a href="/${url}" target="_blank">${event.title}</a>`;

I can't figure out how, or what is introducing this! I'm assuming it's either something in Joomla, or in the rewrite rules (which I tried playing with - but only succeeded in breaking the site, and not resolving the problem).

Any help would be much appreciated...

Many thanks,
Reply all
Reply to author
0 new messages