Advertisement:

Author Topic: Addtional menu item code blanks screen  (Read 1304 times)

Offline mysimplesite

  • Semi-Newbie
  • *
  • Posts: 54
Addtional menu item code blanks screen
« on: July 04, 2017, 11:52:57 PM »
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.

Online Gwenwyfar

  • Customizer
  • Full Member
  • *
  • Posts: 690
  • Gender: Female
    • Gwenwyfar on GitHub
Re: Addtional menu item code blanks screen
« Reply #1 on: July 05, 2017, 12:49:42 AM »
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 .
         ).

Offline mysimplesite

  • Semi-Newbie
  • *
  • Posts: 54
Re: Addtional menu item code blanks screen
« Reply #2 on: July 05, 2017, 01:03:33 AM »
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.

Offline vjulian

  • Newbie
  • *
  • Posts: 6
Re: Addtional menu item code blanks screen
« Reply #3 on: July 06, 2017, 08:50:17 AM »
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