login page attached to related custom message

Re: login page attached to related custom message

by Justin Hunt -
Number of replies: 0
Picture of Particularly helpful Moodlers Picture of Plugin developers

If you are new to Moodle this will involve a lot of clicking and figuring things out and installing a plugin, or writing some PHP. But you can do it.

This project is about what the user should see after they first login, I think.

In most sites this will be the user dashboard. You can also set it to other pages too. See here:

https://docs.moodle.org/34/en/Dashboard#Default_home_page

If you use the dashboard, you can customize the appearance by putting blocks on it. You can even put a block at the very top in the center. That sounds perfect. Well its a bit tricky because the "default dashboard" and the 'user dashboard" are different. Its easy to think you are customizing the default dashboard, when its really your personal one. But thats one of the learnings you will encounter in this journey. 

Now there are all sorts of blocks and you can even write your own if you know how to write PHP and like coffee and late nights. But a good one to start with is the HTML block. Because you can freely edit it with the HTML editor and add pictures and comic sans (my favorite font) and stuff.

Now all we need to do is to get the data from the database into the HTML block at the top center of the dashboard. Enter the Generico filter (my plugin ...everyone groans ...). But really ... it will do the trick. And it will mean you do not need to write your own plugin. Its how I do this sort of thing for other people's sites.  

You can put a custom SQL query into a Generico template and it will fetch it and display it on the page.  The filter will look for crafty little Generico strings, that look like this: {GENERICO:type=essmatask,username=bobthebuilder}, and replace them with whatever your template says to.

The docs for Generico are here:

https://docs.moodle.org/34/en/filter_generico

That at least is how I would approach this project.