Linking glosaries to materials.

Linking glosaries to materials.

le Philip Percival -
Number of replies: 7
We have some materials which for complicated reasons are produced as webpages and stored in a sub f9older of the VLE called materials.

It would be wonderful to be able to add glossary linking to these pages.

My experimental page is a php page and I have added

require_once("$/config.php");
require_once($CFG->dirroot .'/course/lib.php');
require_once($CFG->dirroot .'/lib/blocklib.php');
to the top of the page

No error message, but no links either.

Can anyone save me hours please.

Thanks
Average of ratings: -
In reply to Philip Percival

Re: Linking glosaries to materials.

le Philip Percival -
Well I have spent ages staring at the functions in the above libraries etc and after looking at items stored in the database, I feel there must be a function in a library somewhere that I can use, basically to feed my text to and come back with the markup for the glossary.

The line in the above should have read
require_once("/config.php"); (actually slightly different on my server)

A pointer or two would be most welcome

In reply to Philip Percival

Re: Linking glosaries to materials.

le Chiang Sabrina -
My experience is setting the filter "your website/admin/filters.php" . Let the "glossary and Resource Names Auto-linking " seen. Then it will work.


In reply to Chiang Sabrina

Re: Linking glosaries to materials.

le Philip Percival -
The Filters are set to "Seen" and are working beautifully for all pages within the moodle. My problem is that these pages are not within the moodle. They happen to be on the same server in a sub-folder called materials. They need to be like this for a number of complicated reasons. I have put a link to them and they open in a new window.
In reply to Philip Percival

Re: Linking glosaries to materials.

le Philip Percival -
Thanks to those who may have looked, I think I have found the function now and it seems to be working well.
In reply to Philip Percival

Re: Linking glosaries to materials.

le Jaro Bari -

Hi Philip, I have the same problem, that I have materials as external html files and I would like to know how did you solve this problem.

Anybody answers are welcome smile

Thnx very much

In reply to Philip Percival

Re: Linking glosaries to materials.

le Jaro Bari -

Hi Philip, I have the same problem, that I have materials as external html files and I would like to know how did you solve this problem.

Anybody answers are welcome smile

Thnx very much

In reply to Jaro Bari

Re: Linking glosaries to materials.

le Philip Percival -
This is how I solved it

First
of all make sure your glossaries are working within the moodle, i.e all the setting are correct (lots of posts here to this effect including Chiang Sabrinas' above). ie must be switched on, global glossaries etc.

Your external stuff, must be a php file rather than straight HTML as it has to run a couple of things past moodle.

At the top of your php file include the line

require_once("the_path/config.php");

where "the_path" is the route from your files to the main config.php

gather all your page in a variable say $b
the run it through the following function
$b=filter_text($b, $courseid=NULL);

then something like

print $b;
to put it on the screen.

I hope this works for you as well feel free to get back to me if I have not explained properly