relative links in HTML editor in IE

relative links in HTML editor in IE

deur Gustav W Delius -
Getal antwoorde: 15
The code for the HTML editor has been modified by someone so that in IE all relative links are converted to absolute links relative to the form page. That is clearly undesirable. For example if one uploads a set of html pages that refer to each other with relative links then they work fine in Moodle but as soon as one edits one of them in the HTML editor the links break. Can anyone remember why the modification was made?
Gemiddeld van beoordelings: -
In antwoord op Gustav W Delius

Re: relative links in HTML editor in IE

deur Janne Mikkonen -
Backups!

Sorry that I haven't participate enough lately, but I'm quite sick at the moment (theres something wrong with my teeth and maxillary sinus <- what a word???. And I'm using quite strong pain killers).

This is something that needs to be sorted out before anyone can start to create bookmark feature on the editor. Relative links or absolute links.

Cheers,
Janne
Gemiddeld van beoordelings: -
In antwoord op Janne Mikkonen

Re: relative links in HTML editor in IE

deur Gustav W Delius -

Hi Janne, that was an amazingly quick reply!

Sorry to hear that you are in pain. My best wishes.

Can you explain a bit more what you mean by Backups?

Gemiddeld van beoordelings: -
In antwoord op Gustav W Delius

Re: relative links in HTML editor in IE

deur Martin Dougiamas -
Prentjie van Core developers Prentjie van Documentation writers Prentjie van Moodle HQ Prentjie van Particularly helpful Moodlers Prentjie van Plugin developers Prentjie van Testers
Backups need to have full URLs so that the backup code knows what to do with links ... relative links don't always translate.

Even more importantly is emails, and filtering ... in which stuff fail to work with relative paths.

    http://moodle.org/mod/forum/discuss.php?d=3557

Sorry to hear about the illness, Janne!  Get well soon!
Gemiddeld van beoordelings: -
In antwoord op Martin Dougiamas

Re: relative links in HTML editor in IE

deur Petr Skoda -
Prentjie van Core developers Prentjie van Documentation writers Prentjie van Peer reviewers Prentjie van Plugin developers
We could force all browsers to convert relative links to absolute ones, with the exception of relative anchors of course.

The relative linking of uploaded html files accessed through file.php is very problematic. IMHO all links should be strictly absolute, backup/restore process handles all necessary relinking.

Could anybody please supply some examples where he/she thinks relative links could be really useful?

skodak
Gemiddeld van beoordelings: -
In antwoord op Petr Skoda

Re: relative links in HTML editor in IE

deur Martin Dougiamas -
Prentjie van Core developers Prentjie van Documentation writers Prentjie van Moodle HQ Prentjie van Particularly helpful Moodlers Prentjie van Plugin developers Prentjie van Testers
None of this is relevant for uploaded files ... relative links should be working fine for all cases under file.php (as long as you have slasharguments turned on).  Relative links in uploaded files are very important to have.

Can you give an example otherwise?
Gemiddeld van beoordelings: -
In antwoord op Martin Dougiamas

Re: relative links in HTML editor in IE

deur Petr Skoda -
Prentjie van Core developers Prentjie van Documentation writers Prentjie van Peer reviewers Prentjie van Plugin developers
Relative links do work, but editing of uploaded files in HTMLArea in IE does not work - all relative links are converted to absolute links without file.php and arguments hartseer

Example
page: http://mysite/file.php/2/something/other.html
HTMLArea in IE coverts relative link: href="hmm.html"
to: href="http://mysite/files/hmm.html"

http://mysite/files/index.php is the address of the page with HTMLArea used for editing.
Gemiddeld van beoordelings: -
In antwoord op Petr Skoda

Re: relative links in HTML editor in IE

deur Petr Skoda -
Prentjie van Core developers Prentjie van Documentation writers Prentjie van Peer reviewers Prentjie van Plugin developers
This IE specific problem with relative links in uploaded files could be solved in function stripBaseURL from htmlarea.php. First check if baseURL starts with "$CFG->wwwroot/files/" - in that case remove baseURL from the string argument to create relative link.
Gemiddeld van beoordelings: -
In antwoord op Petr Skoda

Re: relative links in HTML editor in IE

deur Ron Banks -
Right now I have a need in creating books that need more than one level of subchapters, which if I used subchapters anyway the TOC gets too long and cumbersome in the book as the sub chapters do not collapse (this would be a good feature in the book mode - collapsing subheadings - another issue, another time).  Therefore, I am trying to create subchapters and below using relative links within the html but it keeps breaking as it tries to make absolute links to itself.
Gemiddeld van beoordelings: -
In antwoord op Ron Banks

Re: relative links in HTML editor in IE

deur Petr Skoda -
Prentjie van Core developers Prentjie van Documentation writers Prentjie van Peer reviewers Prentjie van Plugin developers
Recent fix in 1.4CVS should solve your problem with relative anchor links, it may eventually be merged back to 1.3.1+ branch.

If you need "longer" books, please consider creating several books instead of one. Loooong books are hard to read and hard to print. You can also manually create master TOC on the first page of each book. On the main course page books can be grouped (label followed by indented list of books).

I am planning the collapsible TOC after the introduction of templates in Moodle.

Decision not to implement more levels was pedagogical, it could be implemented within several hours. Maybe after TOC display is somehow improved, I will add one more level knipoog
Gemiddeld van beoordelings: -
In antwoord op Petr Skoda

Re: relative links in HTML editor in IE

deur Ron Banks -

Thank you for working on this.  I will be looking forward to the 1.3.1+ and 1.4 coming out.  I will try it out on the 1.4CVS as well.  I appreciate your work as it benefits us all.

You talked of manually creating a master TOC on the first page, could you be more specific?  I am assuming your are speaking of creating links in the first page.

Your label approach is quite creative.  I had not thought about that.  I will try to implement that and see the results.

Ron Banks

Gemiddeld van beoordelings: -
In antwoord op Ron Banks

Re: relative links in HTML editor in IE

deur Petr Skoda -
Prentjie van Core developers Prentjie van Documentation writers Prentjie van Peer reviewers Prentjie van Plugin developers
"Master TOC" was just an idea, you understand it correctly. Usually the first page of a book contains some book description, manually created links to some other books could help with the orientation.
Gemiddeld van beoordelings: -
In antwoord op Martin Dougiamas

Re: relative links in HTML editor in IE

deur Gustav W Delius -

Ah yes, I forgot that this issue had been discussed before. So I understand the value of converting relative links to absolute links now. But surely a relative link should be converted to an absolute link with respect to the page itself, not the editor page.

We currently have the situation that when using the HTML editor on mozilla converts relative links to absolute links but on IE relative links are converted to absolute links with respect to the editor page.

If I understand correctly neither is what we want. Rather we want in all browsers all relative links to be converted to absolute links with respect to the actual page.

Gemiddeld van beoordelings: -
In antwoord op Gustav W Delius

Re: relative links in HTML editor in IE

deur Petr Skoda -
Prentjie van Core developers Prentjie van Documentation writers Prentjie van Peer reviewers Prentjie van Plugin developers
Another solution could be to force users to enter only absolute paths or relative anchors. Simple popup would inform users that relative links are not allowed, they could be also given some info on how to write absolute links.

Other users (not using HTMLArea) should be given some general info on what links Moodle works with and how backup/restore works.
Gemiddeld van beoordelings: -
In antwoord op Petr Skoda

Need relative links instead of absolute ones

deur Lancelot Dulac -
Hi all!

I´m new to this, so excuse me if my question has already been answered in this thread and I didn´t understand it.

I have a dynamic ip in my server, which means that whenever I´m starting it, all the absolute links (wee icons in the forums, pictures, etc) stop working.

I´d rather have relative links which would stay there regardless of the ip, linking to say "moodledata/sessions/2/file" instead of http://myip/Myfolder/...

Any suggestions about how to fix this problem? Thanks a lot
Gemiddeld van beoordelings: -
In antwoord op Petr Skoda

Need relative links instead of absolute ones

deur Lancelot Dulac -
Hi all!

I´m new to this, so excuse me if my question has already been answered in this thread and I didn´t understand it.

I have a dynamic ip in my server, which means that whenever I´m starting it, all the absolute links (wee icons in the forums, pictures, etc) stop working.

I´d rather have relative links which would stay there regardless of the ip, linking to say "moodledata/sessions/2/file" instead of http://myip/Myfolder/...

Any suggestions about how to fix this problem? Thanks a lot
Gemiddeld van beoordelings: -