Referencing uploaded files

Referencing uploaded files

by James Robertson -
Number of replies: 0

I am setting up some html pages (code outside Moodle) and want to reference some standard graphics that are used many times.  I can reference the graphic in its present location by putting "/moodle/file.php/2/graphics/xxx.jpg" in the html editior text mode, and it adds the stem for me.  But the course won't usually be 2.  I can load the graphics into the public are and use "...file.php/1/..." and that works, but I would rather find a better way. 

I noticed when I left off the leading slash, the editor added the stem plus "/moodle/course/".  That looked promising but I couldn't get it to find the graphic.  Is there some way that "course" returns the internal course number?  Or is there another way to reference an uploaded graphic, given that the path from the course directory is known, without including the path to the course directory?

Thanks,

Jim Robertson.

Average of ratings: -