Subfolders and HTML Links

Subfolders and HTML Links

de Howard Miller -
Number of replies: 6
Imachen de Core developers Imachen de Documentation writers Imachen de Particularly helpful Moodlers Imachen de Peer reviewers Imachen de Plugin developers
Can I do this?.....

I uploaded a file called, say, test.html.

it has an element within...
logo.jpg

so, I created a sub-folder called "images" and loaded "logo.jpg" into it. It doesn't work! Can I do this kind of thing?

I suppose in general can I put links to other documents/images inside a html file?

Even more generally - how do you tell where resources will be from the standpoint of a HTML link. For example, I have seen forum messages on the moodle site that link to external resources. How is that accomplished?
Promeyo de puntuacions: -
In reply to Howard Miller

Re: Subfolders and HTML Links

de Paolo Lariccia -
Translated in a different language it would be great if one could authomatically transfer a complex HTML file with its links to image files(OLE style). I wish somebody could do it!
In reply to Paolo Lariccia

Re: Subfolders and HTML Links

de Martin Dougiamas -
Imachen de Core developers Imachen de Documentation writers Imachen de Moodle HQ Imachen de Particularly helpful Moodlers Imachen de Plugin developers Imachen de Testers
Yes, this is perfectly possible.

You need to make sure that the page and the images are all transferred together to the server. The easiest way to do this is to "zip" them up in a archive, upload it, then "unzip" it on the server.

You also need to make sure that the links and images use relative links:

Yes: images/myimage.jpg

No: C:\My Documents\images\myimage.jpg

If the images or links are already published on a web server somewhere then it is of course OK to use full URLs like
In reply to Martin Dougiamas

Re: Subfolders and HTML Links

de Howard Miller -
Imachen de Core developers Imachen de Documentation writers Imachen de Particularly helpful Moodlers Imachen de Peer reviewers Imachen de Plugin developers
Mmmm... doesn't work for me!

I did this....

I set up the web pages and images, all with relative links and tested it all outside of moodle.

I zipped it, uploaded it into moodle. All ok.. so far so good.

In Activities I selected "Add a Resource", chose "uploaded file". On the next page, I selected the index page of my mini-site.

The index page loads but nothing that it links to is accessible.

I have tried to load the page in-situ where it has been uploaded on the server, and it works fine.

Any thoughts as to what I am doing wrong much appreciated!
In reply to Martin Dougiamas

Re: Subfolders and HTML Links

de Howard Miller -
Imachen de Core developers Imachen de Documentation writers Imachen de Particularly helpful Moodlers Imachen de Peer reviewers Imachen de Plugin developers
Mmmm... more information.

My html pages look like this...
sec1.html
sec2.html
sec3.html

navigation at the top of each page points to the other pages relatively...
e.g. href="sec2.html".

Now, my moodle site originates at something like...
http://host.domain/moodle

When I mouse-over the link the status bar at the bottom of the browser says this....
http://host.domain/moodle/sec2.html

This cannot possibly be correct! Moodle loads the first page (correctly) with the following link from the frame...

http://host.domain/moodle/file.php?file=/3/test_pages/sec1.html

Confused..... very....
In reply to Howard Miller

Re: Subfolders and HTML Links

de Martin Dougiamas -
Imachen de Core developers Imachen de Documentation writers Imachen de Moodle HQ Imachen de Particularly helpful Moodlers Imachen de Plugin developers Imachen de Testers
Ah! There is a problem here when not using slasharguments (which you just switched off of course because it didn't work on your server!)

Most sites do use slasharguments so this bug has never come up before. Without slasharguments relative links are going to be relative to the file file.php which is in the root of Moodle.

D'oh.

One (slightly bodgy) solution would be to change all your links to full links like http://host.domain/moodle/file.php?file=/3/test_pages/sec2.html

A second (better) solution would be to explore why slasharguments just doesn't work on some servers. Is there an Apache setting for it? There must be, because Howard's machine is Redhat 8.0, and slasharguments works fine for me on Redhat 7.3. Does some enterprising soul with more time than me want to look into this?
In reply to Martin Dougiamas

Re: Subfolders and HTML Links

de Howard Miller -
Imachen de Core developers Imachen de Documentation writers Imachen de Particularly helpful Moodlers Imachen de Peer reviewers Imachen de Plugin developers
Ah... I get the picture.

Yes... I can handle trying to fix the slasharguments thing, although right now I'm not sure where to start looking!!!

If anybody knows, or even has a clue, it would be appreciated.

Thanks....