Navigating a logged-in user adding an item

Navigating a logged-in user adding an item

Łukasz Kurowski發表於
Number of replies: 2

Hi,

I have searched the entire forum and moodle doumentation and did not find an answer to my question I would like to add 2 links to the user menu in moodle I added a function.

In lib.

"/enrol/beeqp24/lib.php"

"

function local_beeqp24_extend_navigation(

        global_navigation $nav

    ){

        echo "asd";

    }

"

I made it this way so that only brakepoint is set.

Please help i have no idea

評比平均分數: -
In reply to Łukasz Kurowski

Re: Navigating a logged-in user adding an item

helin avsar發表於
Hi there,

Adding custom links and items to the user menu in Moodle can definitely be tricky! I've tried to do the same thing before with mixed results.

It looks like you're on the right track with creating a function in lib.php and using the global_navigation parameter to modify the nav. The echo was a good idea just to test that your function is being called.

A couple suggestions that may help get it working:

Try using the $nav->add() method to add new navigation nodes, like $nav->add('My Link', new moodle_url('/my/link/url')).
Make sure your function name follows the proper format - it should start with the prefix local_ followed by your plugin name, like local_mypluginname_extend_navigation.

Check that your plugin's version.php is configured correctly and the plugin is installed and enabled on your Moodle site.

Add some debugging echoes or logs in your function to see step-by-step if it's being called when you would expect.

Definitely let me know if you have any other questions! Moodle navigation can have a lot of little steps to configure properly. Don't hesitate to post any errors or unexpected behavior. Happy to help troubleshoot further!
In reply to helin avsar

Re: Navigating a logged-in user adding an item

helin avsar發表於
Let me know if it works?  So in summary, 2024 has an extra leap day in February, starts and ends on Monday, and contains all the expected annual holidays and events. Let me know if you need any other 2024 calendar details!