The reasons I would not like to use absolute URLs are:
1. It prevents us from being able to export the course (this is the main reason)
2. It can cause problems for course maintainability generally, e.g. if we ever move servers or change the main URL, it may "get forgotten", in time, that absolute URLs are being used within the course content
I found this thread:
... where Martin suggests going to Admin > Modules > Filters and turning on the "Resource Names Auto-Linking" filter.
However, this is not quite what we're looking for, as it doesn't give us control over the anchor text of the link.
For example, in our existing course, to take one example, the anchor text of the link says "Let's find out >>"
If we were to use the Resource Names Auto-Linking filter, we would be limited to only using the names of the resources as the anchor text.
Does anyone know if it's possible to do what we want without using absolute URLs?
If not, may I suggest this as a desired feature, for the reasons I mentioned above?
If not try setting up a hyperlink from one resource page to another using a relative url...
<a href="../resource/view.php?inpopup=true&id=7" >Related Topic</a>
Thanks for that suggestion. Yes, I guess that will work It certainly will solve issue 2 ... but do you know whether it will solve issue 1?
For example, if I were to save a course, using relative URLs in this way, would I be able to export it to other installations of Moodle, or even other LMSs?
I have a similair problem
I can set up a search function within the main header block and by using "adding a label"can create a quick search tool for students so that they can click on a number and go direct to that topic block
it is alliabsolute reference - have you got some HTML that i could se that would make it a relative URL
So for example... if you go to my Moodle test site HERE - this is a resource page I have linked to another page which has a related topic...this is the HTML I used for that related topic link...
<a href="../resource/view.php?inpopup=true&id=7">Why use styles?</a>
The ABSOLUTE reference to that particular page is...
So you can see I have replaced this part of the hyperlink ...
with ../ which transforms it into a RELATIVE reference point which I used in my hyperlink.
Hope this all helps?
thanks mary thats brilliant- will play with this code
Came upon this because I've run into this particular problem with a course backup that was restored to the same installation.
"For example, if I were to save a course, using relative URLs in this way, would I be able to export it to other installations of Moodle, or even other LMSs?"
Apparently the resources are assigned new ids, breaking those absolute links. That means a relative link wouldn't work either. I
've only actually experienced this with a course copy restored to the same Moodle installation, but I suspect that they'd get new ids in a different installation of Moodle also (so as not to duplicate any existing ids in Moodle, I guess?).
I'm in the process of fixing those broken links now, quite a pain. If anyone else has a solution for this it would be great to hear it!
Unfortunately no solution but i can confirm that restoring to a different installation of moodle also breaks the links
we usualy build links in the site
What do you mean by "build links in the site"?
I ended up removing an absolute link that we had on every resource page. Others we will have to discover as they come up.
sorry shouldve been more specific
what i meant was that we usually build these absolute links in the site that is going to be used by the student for the semester ( hence the absolute reference that usues the site ID stays for that semester. but we still have a problem when restoring that site to a new site in the same environment for the next semester as the ID changes- i am looking at a way to do this withiout beaking lnks( linking from one web page to another web page but havnt found a solution as yet
I have tried creating the new course from a restore of an existing course and also as creating a course "shell" and then importing the existing content into the new shell. Didn't see much difference.
I would be very interested to hear any solutions for this! thanks!