Database

Database auto-linking (one to many?)

 
Mt. Fuji
Database auto-linking (one to many?)
 

Dear all,

I have a quick question about auto-linking with the database module. I have entries in the database for classes taught by professors at my university. Elsewhere in the same course I have a page with text introducing curriculum, registration processes, etc. The teacher's names link to the entries in the database, as I want, but it was just pointed out that when a teacher has more than one entry in the database (they teach more than one course) the link only points to one entry.

Is there a way to have the link go to a list of all the entries with that teacher's name...? It seems like this should be possible but I cannot find a setting that would allow me to set it up.

Regards

Jason

 
Average of ratings: -
Mt. Fuji
Re: Database auto-linking (one to many?)
 

Dear all,

Adding a little to this inquiry:

What I want to accomplish is the same thing that can be accomplished by using the "Advanced search" function in the database. It's just that I want the auto-link to return all applicable entries (in list view) instead of just the 1st one it finds, which is what I suspect it is doing.

Jason

 
Average of ratings: -
Picture of William Lu
Re: Database auto-linking (one to many?)
Particularly helpful Moodlers

Yes, the 'Auto-linking' can only link to ONE entry.

I presume that you are using a 'Teacher's name' and a text field for your auto-linking, and you have more than one entries with the SAME name field. It may not work as you expected.

To work around this, you can try to only enter one unique entry for on teacher's name. In this entry, list all links to their courses. Each link can be one Database entry in the same Database (or any other Web page). Like this:

1. Teacher John Add Entry 0, in the text field, he enters "John", in the Textarea field, he will enter a list of links.

2. Teacher John Add Entry 1, in the text field, he enters "John's course101 intro", in the Textarea field, he will enter a long intro about course101.

3. Teacher John Add Entry 2, in the text field, he enters "John's course202 intro", in the Textarea field, he will enter a long intro about course202.

4. John repeats step 2 and 3 for all of his courses

5. Enable auto-linking to Database entry and all text 'John' will link to his Entry 0 which can be the "Index page" or a "TOC(Table of Content) page". (You can also use a Glossary entry as the TOC, and enable Auto-linking to Glossary if you don't want to use the same Database template for TOC and Course Intro)



 
Average of ratings: Useful (1)
Mt. Fuji
Re: Database auto-linking (one to many?)
 

William,

Thank you for your response and for this clever workaround. Unfortunately, I think I'm going to go the route of simply turning off auto-linking (unfortunately) as we will have students navigating to the database from various pathways and the workaround might make their experience, if they use the advanced search for example, confusing.

I haven't looked at the code specific to auto-linking but wonder how hard it would be to adjust it to return the same thing the advanced search does...it's not something I have the time to do at the moment though so I'll put it on my long list of things to look into when I find time (or maybe I should say "if"). smile

Thanks again for your help and support.

Regards

Jason

 
Average of ratings: -
Picture of William Lu
Re: Database auto-linking (one to many?)
Particularly helpful Moodlers

Hi Jason,

The auto-linking is a filter,  "To return the same thing the advanced search does" might not be easy, I won't suggest you try it even you can find a time, haha.


 
Average of ratings: -
Picture of Jon Bolton
Re: Database auto-linking (one to many?)
Testers

You could use the Database tag input field type plugin - https://moodle.org/plugins/datafield_tag

Works a treat - see http://practicelearning.info/mod/data/view.php?id=258 for a working example. Click on an author's name and it will show you all entries for that author.

 
Average of ratings: Useful (2)