Best practice forum (Archived)

Totara Menu - adding in links

 
? ?
Totara Menu - adding in links
door ? ? - Sunday, 1 May 2011, 18:29 PM
 

I have been cusotmising the Totara menu file by hiding and adding in links within in it (local/totara_menu.php).

I added in an additional main tab link called Help (which links to a help course), but when it displays it appears as [[Help]] in the header and footer menu

[help menu screenshot]

This is the code i added to the php file:

line 53:

 //added in help link
    'help' => array()

lines 80:

//added in help link
    'help' => '/course/view.php?id=19'

lines 261:

 <!--added in help link-->
     <li class="last<?php echo $selected['help']; ?> menu7">
        <div>
        <a href="<?php echo $CFG->wwwroot.'/course/view.php?id=19' ?>"><?php echo get_string('Help', 'local') ?></a>
        </div>
    </li>

Also, why is the image uploader not working now for this post?

Craig Eves
Re: Totara Menu - adding in links
door Craig Eves (Totara Support) - Sunday, 1 May 2011, 19:24 PM
Groep Totara

Hi Ira

I tried the image uploader in Firefox and this seems to works Ok 

What browser and operating system are you using?

test

Craig

? ?
Re: Totara Menu - adding in links
door ? ? - Sunday, 1 May 2011, 20:41 PM
 

Hi,

I'm using Firefox 3.6 on Mac OS X 10.6 - i just get a Insert link dialog box when i click on the browse button for image URL field...

that wasn't the issue i was worrying about, just noticed it when posting to the forum

I want to know why my additional link to the menu appears like this [[Help]] instead of Help

cheers

Simon Coggins
Re: Totara Menu - adding in links
door Simon Coggins - Sunday, 1 May 2011, 21:01 PM
Groep Totara

Can you try this and let me know if it's still not working for you:

1. Click the picture icon

2. Click the browse button next to the image URL field

3. In the dialog that comes up, click 'Browse' near the bottom

4. Choose a file

5. Click the 'Upload' button (also near the bottom).

6. The file should appear in the main window. Click the filename.

Simon

? ?
Re: Totara Menu - adding in links
door ? ? - Sunday, 1 May 2011, 23:55 PM
 

i don't see a browse link in the dialog box in step 3 anymore...

last week it was working fine

Simon Coggins
Re: Totara Menu - adding in links
door Simon Coggins - Monday, 2 May 2011, 16:54 PM
Groep Totara

I've tried to reproduce it with Firefox 3.6.15 on Mac but everything seemed okay for me. I'm going to need a bit more info to help me.

Can you let me know the full release version you are using so I can try with exactly the same version of firefox. You should be able to see that via Help > About Firefox

Send me a screenshot of the 'add link' dialog (the one that's missing the browse button). Obviously you can't upload it because of the issue, but maybe you could try a different browser, or alternatively email it to me at simon.coggins@totaralms.com.

Simon

Simon Coggins
Re: Totara Menu - adding in links
door Simon Coggins - Sunday, 1 May 2011, 20:57 PM
Groep Totara

The double brackets indicate language strings with no matching entry in the language pack.

When you add text in moodle, you need to add it to the language pack, so that it can be translated into multiple languages. In your code you added:

get_string('Help', 'local')

which means you need to add this line into lang/en_utf8/local.php:

$string['Help'] = 'Help';

Simon

? ?
Re: Totara Menu - adding in links
door ? ? - Monday, 2 May 2011, 16:34 PM
 

thanks , that fixed it smile

Nurhaisyam Satar
Re: Totara Menu - adding in links
door Nurhaisyam Satar - Thursday, 19 May 2011, 02:32 AM
 

Hi,

i added a new menu under course. The thing is, why does the whole group under course,  seems to appeared twice?


Simon Coggins
Re: Totara Menu - adding in links
door Simon Coggins - Thursday, 19 May 2011, 14:18 PM
Groep Totara

That menu isn't the totara menu (the navigation along the top of the page), it's the Site administration menu.

Without seeing exactly what you've changed it's a bit hard to help, can you post the changes you made?

Simon

Nurhaisyam Satar
Re: Totara Menu - adding in links
door Nurhaisyam Satar - Thursday, 19 May 2011, 18:44 PM
 

Oh, sorry, i thought the post is about the admin menu... I've added a new line in the admin/setting/courses.php

// Pending course requests.
    if (!empty($CFG->enablecourserequests)) {$ADMIN->add('courses', new admin_externalpage('coursespending', get_string('pendingrequests'),$CFG->wwwroot . '/course/pending.php', array('moodle/site:approvecourse')));}
 
 //face to face upload
 $ADMIN->add('courses', new admin_externalpage('faceTofaceUpload', get_string('faceTofaceUpload'),$CFG->wwwroot . '/admin/upload/uploadSchedule.php'));

    // "backups" settingpage
    if (!empty($CFG->backup_version)) {
$bi = array();
$bi[] = new admin_setting_configcheckbox('backup_sche_modules', get_string('includemodules'), get_string('backupincludemoduleshelp'), 0); 

i just copied the previous line, the course pending request, paste under it and made some adjustment .

Funny thing is, if for example i delete the new line that i've added, and upload to the testing site, the link will still appear twice.

Does anyone have any idea about this? Thanks in advance.

Simon Coggins
Re: Totara Menu - adding in links
door Simon Coggins - Wednesday, 25 May 2011, 16:28 PM
Groep Totara

Hi Hazmy,

I think what's probably happened is that you've created a copy of the original courses.php file in the admin/settings/ directory. Maybe a backup version called courses2.php ?

Be aware that the menu will automatically include any file in that directory as part of the menu - I just tested it and putting another copy of the courses.php file results in similar duplication for me.

Simon

Nurhaisyam Satar
Re: Totara Menu - adding in links
door Nurhaisyam Satar - Monday, 6 June 2011, 01:32 AM
 

Hi Simon,

Sorry for the late reply, been busy for the past two weeks for my wedding ceremony. Thanks! It works. I save my file as course-backup.php and did what you ask and voila, seems ok right now. Thanks again. Really appreciate your help. big grin