Moodle Links

Moodle Links

by Koorosh Azhandeh -
Number of replies: 5

Hello All 

In our organization we develop a course in Development environment and promote it to QA and finally move it up to prod and make it live.

We want links to other parts of the same course to work in each environment.  Using relative links resolves the domain change but does not solve the change in course id.  Is there another way to build a hyperlink so that moodle knows to link to the current course without specifying the course id?


I am using Moodle 3.5.5.

Let me know if you have any suggestions

REgards, 

Koorosh 

Average of ratings: -
In reply to Koorosh Azhandeh

Re: Moodle Links

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
I've read this several times and still don't understand the question. Can you expand and/or give an example, perhaps?
In reply to Howard Miller

Re: Moodle Links

by Koorosh Azhandeh -

Hello. Thank you for your prompt response. What I am asking is technically is there any automated way to update all the links when importing and exporting a course from one server to another server?

We develop courses in one server and export and import to different server. Most of the time we find some broken links after importing them to the new server 

Thank you for your help

Koorosh

In reply to Koorosh Azhandeh

Re: Moodle Links

by Jon Bolton -
Picture of Particularly helpful Moodlers Picture of Testers

The FilterCodes plugin allows you to use a placeholder that will be replaced by a value.
{courseid} or %7Bcourseid%7D displays a course's ID.

So you could create relative urls combined with FilterCodes, eg.

/course/view.php?id={courseid}

See https://moodle.org/plugins/filter_filtercodes

Average of ratings: Useful (1)