|
Cookbook /
AutomaticLinksSummary: How to automatically create Crosslinks for use in, e.g., a glossary
Version: 2006-02-24
Prerequisites:
Status:
Maintainer: Klonk
Categories: Links
QuestionHow to automatically create Crosslinks for use in e.g. a glossary? AnswerUse the script autolink.phpΔ . Insert the following line in your NotesThis script takes the titles of all files in a specific group and saves them together with the filename in a file called ".autolink-<groupname>" in the wiki.d directory. This file is dynamically created as soon a file in the group is deleted or changed, the corresponding information is changed also. This file is saved in a compressed format. The first call will create a new file. Thus the loading time of the page for the initial creation of that file might be a little bit longer (up to some seconds), depends on the amount of files within the group though. By default all titles which are shorter than two characters are ignored. This is controlled by the variable The effect the user can see is that the wikipage contains some links that are not marked as links in the wikitext source. E.g the text "Start Page" is converted to e.g. Start Page automatically. Activation of automatic links is currently only possible in the config files. I suggest to only activate it for the desired group. See PerGroupCustomizations for details. Insert the following line: where the string
Releases
CommentsThis script adds noticably to the creation time of a wikipage. In my tests on a windows machine with around 1000 crossreferences added around 0.4 secs to the page creation. I'll try to improve that after the first release. BTW: hints for improving speed are highly appreciated.
'' Hi, I installed the recipe as you described it (at least I think so... the line with the
I tried redownloading the scripts, and I even used a completely new Installation of pmwiki, in case something was wrong with my version. I also tested it both with the Xampp-lite-Server and my webspace (PHP-Version(approve links). But still those error messages kept on occuring, althoug the scripts really seems to work apart from that. Ah, and there was one more thing I noticed: the more groups I added to the "AutoLinkActivate"-string, the more error lines showed up. Martha, same day.
Hallo,
could there be a way to change this dynamic autolinking to a static one? You mean when saving the page e.g. "word" is changed automatically to "[[word]]"? If yes this would require a totally different approach and a complete rewrite of the script. Would make more sense in an own cookbook reciepe - Klonk April 04, 2006, at 01:04 AM
i kept e-mailing and pestering, i sussed how to get it to do cross links on two seperate groups, jsut make a copy of Autolink, name is "autolink2" do a find and replace on "autolink" replace with "autolink2" and change the "sortsize" to "sortsize2" Normally you don't need to do that as for each group you refer to a list of pages is created seperately. The easiest way to achieve this is by placing the autolink in a group header or sidebar, which could be changed per group (depends on the skin you're using) - Klonk April 04, 2006, at 01:04 AM
then do the include and set a nother group for Autolink2 and you are sorted.. obviously will work further on . Chritian Hello. I installed the script and it really works fine for my purpose of a glossary. The only remaining problems are Glossary-Entries which are no possible PageNames (c.t. for example). Any ideas to cope with that? Hi there, thanks for this great add-on. How could I adapt it so that it so that it isn't case sensitive? I've been trying various ways but no luck as yet. thanks for any help you can give! John Hey. Installed this one and it works almost fine. Problem is, that part of the recipe works outside of the specified group too. For example the word 'RecentChanges' in the PmWikiFaq now is a link to 'thatonegroup.RecentChanges'. The recipe looks farly easy and small, but I don't know php really so I can't say what to change how. Any ideas out there? peter 3/8/2008 See AlsoContributors |