News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Addtional menu item code blanks screen

Started by mysimplesite, July 04, 2017, 11:52:57 PM

Previous topic - Next topic

mysimplesite

2.0.14, php7.1, ShelfLife theme

In 2.0.14 Sources folder found Subs.php and found section for menus. Haven't done coding for 40 plus years so copied some suggestions from Documentation but obviously have messed something up.

All I want to do is add a menu link from SMF to my other site.

Added this code, which blanks screen. Code starts at line 4145.

// Add menu link for my site .
         ).
         'mysimplemess' => array (   
         'title' => $txt['My Simple Mess'],
            'href' => 'https://blahblahblah.com/',
            'show' => true,
            'sub_buttons' => array(
             ),
            'is_last' => !$context['right_to_left'],
      // End menu link addtion


I added that code before the
),
         'logout' => array(
            'title' => $txt['logout'],
            'href' => $scripturl . '?action=logout;%1$s=%2$s',
            'show' => !$user_info['is_guest'],
            'sub_buttons' => array(
            ),
            'is_last' => !$context['right_to_left'],
         ),
      );


Thanks in advance.

Gwenwyfar

Where you added "'title' => $txt['My Simple Mess'], ", have you actually defined an existing variable there? If you're trying to use a variable that doesn't exist it can give you problems.

Also if you left a dot on the first line of your code, that could give a syntax error. Try a comma there.

// Add menu link for my site .
         ).
"It is impossible to communicate with one that does not wish to communicate"

mysimplesite

You hit the nail on the head, Gwenwyfar. I didn't define a variable. Sheesh. I'm getting too old for this. Fixed the dot issue too.

Thanks. Consider this solved.

vjulian

Wow believe me i was facing similar problem today and just came across this thread. It solved my problem like a charm. I mean what are the odds. :o

Advertisement: