You need to be logged in to post in the forum - Log In

An active JCE Pro Subscription is required to post in the forum - Buy a Subscription

Support is currently Offline

Official support hours
Monday to Friday
09:00 - 17:00 Europe/London (BST)

Please create a new Ticket and we will get back to you as soon as we can.

#99666 Hyperlinks of uploaded documents in Administrator Custom Module

Posted in ‘Editor’
This is a public ticket

Everybody will be able to see its contents. Do not include usernames, passwords or any other sensitive information.

Latest post by pe7er on Friday, 26 April 2019 11:51 BST

pe7er
I am using JCE Editor Pro 2.7.11 with Joomla 3.9.5
In the back-end I've created an Administrator Custom Module.
After uploading a document with JCE and saving the module, the links in the administrator module are broken.

Testing instructions
Extensions > Modules > [Administrator] > New > Custom
Title: Test
Position: c-panel
Text:
test: + upload a PDF + select to show icon

HTML result:
<p>test: <a class="wf_file" href="https://www.joomlacontenteditor.net/images/dummy.pdf"><img class="wf_file_icon" style="border: 0px; vertical-align: middle; max-width: inherit;" src="https://www.joomlacontenteditor.net/media/jce/icons/pdf.png" alt="pdf" /><span class="wf_file_text">dummy.pdf</span></a></p>

The result
The Control Panel shows the Custom Module, but the links *image + link to download) are broken because Joomla puts /administrator/ in the links:


Could you please add slashes to the hyperlinks so that Joomla won't add /administrator/ to the links?
So like:
href="https://www.joomlacontenteditor.net/images/dummy.pdf"
src="https://www.joomlacontenteditor.net/media/jce/icons/pdf.png"

Attachments

Ryan
Normally, processing of urls is done by the Joomla System - SEF plugin, which adds the leading slash or other appropriate path when SEF is enabled, and the content is displayed in the front-end.

This is not done in the Joomla Admin, which is why you are seeing the issue.

To rectify this, you will need to add the leading slash to the url yourself, when insert the image, or add some processing of the module content to do this for you.

Here is a code sample that you might try that will add the leading slash links and images - https://gist.github.com/ryandemmer/477f81832e7bb306417bea088443d51b

A more complex one could be obtained from the System - SEF plugin.

Ryan Demmer

Lead Developer / CEO / CTO

Just because you're not paranoid doesn't mean everybody isn't out to get you.

pe7er
Ok, thanks for your answer Ryan!

I hoped it was an issue that could be easily fixed in JCE itself...
It's no problem for me to add it manually in custom back-end modules.

However I've the same issue with content that is displayed in the back-end.
For that case I'll better use custom fields to let them add a couple of documents...
Thanks!