Link but then switch off?

Link but then switch off?

by Timothy Takemoto -
Number of replies: 4
I have a fairly large glossary on a lot of course pages. I would like to link to the resources on my pages and then turn off autolinking because I do not need any other part of my site to be linked. But I think that if I turn off autolinking the links that are already there will dissappear.

Please would someone be so kind as to tell me the procedure for turning on autolinking, linking up some recourses, and then turning off autolinking leaving the links already created in place?

Tim
Average of ratings: -
In reply to Timothy Takemoto

Re: Link but then switch off?

by Eloy Lafuente (stronk7) -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Peer reviewers Picture of Plugin developers Picture of Testers
Hi Timothy,

that isn't possible. The auto-linking feature does it work on the fly for all the contents in your course. It cannot make differences between resources and the rest, neither modify your resources source (only affect their visualisation if enabled).

I suppose that you could try to enable the filter, view your resources and then copy their html code and paste it over the original, or try to edit your resources adding manual calls to the glossary, but that solutions will be hard, risky and far from optimal.

Ciao sad
In reply to Eloy Lafuente (stronk7)

Re: Link but then switch off?

by Timothy Takemoto -
Thanks Eloy,

Ah...I thought that autolinking actually changed the resource and not just the visualisation. Silly of me.

Hmm....I don't like the idea of risky but it seems possible to turn autolinking off and then manually call the glossary. This sounds like quite a  cool way of achieving autolinking on a limited number of pages. What are the risks?

Please would you be so kind as to tell me the code for manually calling the glossary? I know how to change my theme's header so that it adds lines of code to files that I choose.

Ah, wait,

Does "manual calls to the glossary" mean linking to each of the entries by hand? That would be impossible.

Or does it mean "Oy, autolink to this page!" That would be great.

I am also trying to use the nolink feature but I can't seem to add that headers and have it stretch over the whole page.

Tim
In reply to Timothy Takemoto

Re: Link but then switch off?

by Eloy Lafuente (stronk7) -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Peer reviewers Picture of Plugin developers Picture of Testers
Hi Tim,

"manual calls to the glossary" mean linking to each of the entries by hand!! sad

And I think that you cannot add code for manually calling the glossary. Autolinking works in something that we could call "Moodle-Output-Chain" where EVERY Moodle content is passed to one CENTRAL function. This function executes (in a chain) al the transformations (convert to html, add smilies, process filters...) as needed, depending of your configuration.

So, adding/modifying code in theme header and or enclosing everything inside "nolink" tags won't have effect, because filters are applied at "individual content" level, not at "page" level.

Hope this clarify things a bit...ciao smile

In reply to Eloy Lafuente (stronk7)

Re: Link but then switch off?

by Timothy Takemoto -
Thanks Eloy,

Sorry I should have read this before I posted about the possibility of somepages with autolinking and some pages without.

It looks as though I am not going to be able to use the glossary. Sadness. I compiled the list of 600 (perhaps 550 unuiqe) words. I have almost finished formatting them to webCT format ready for input, but I realise that the 260 word glossary I have on another course is probably too long.

I am not sure of the difference between "page level" and "content level"...other than that one is a bit longer than another. But okay, I can see that if a page is built up heirarchically then it would not be possible to just autolink the whole thing afterwards. However, it should be possible to do a check to see the type of page that one is on, even inside the most CENTRAL, low level of Moodle functions.

AHA, sorry, even if there were some message going to the glossary saying "don't link to non resource pages" the glossary would still be in the output chain and still slowing things down?

But the problem is the number of the words in the glossaries I am trying to use. If the glossary curtailed its job after the first word in non-resource pages then there would be no problem. So while the autolink filter would be in the Moold Output Chain, the auto link filter would NOT be going through 600 words to see whether each of them match the processed text.

I guess that the glossary really a glossary and not an index and certainly not a dictionary.

Pehrpas I will offer a mini dictionary of the 100 most difficult words.

Tim