Menu bug

mattypants's picture
mattypants
Wed, 03/23/2016 - 21:23
#1
Menu bug

I have been having lots of success adding pages using different templates, and adding them to the main menu, and everything has been working until I added third-level menu items. That is when I get the famous multiple warnings.

Here's is an example of the menu structure working, with no bug or warnings:

  • Main menu item

    • main menu secondary item

    • main menu secondary item

    • main menu secondary item

    • main menu secondary item

    • main menu secondary item

    • main menu secondary item

When I add a third level to the menu, I run into problem, and I get a bug (sidebar-bug.png, attached):

  • Main menu item

    • main menu secondary item

    • main menu secondary item

      • main menu secondary item

      • main menu secondary item

      • main menu secondary item

    • main menu secondary item

    • main menu secondary item

    • main menu secondary item

    • main menu secondary item

    • main menu secondary item

Image title

To try to solve this, I went configured the menu block to change the main menu Starting level from secondary to tertiary. This makes the menu display properly, but I then get all the warnings.

Hope you can help, thanks.

phuonght's picture
phuonght
Thu, 03/24/2016 - 03:15

Hi,

At the moment, sidebar menu only supports one level. If you would like to use multi-level menu, please take a look at module https://www.drupal.org/project/nice_menus.

You need to create your new own menu (do not use main menu any more) in Structure > Menu. For example: we will name menu as "Sidebar menu" then use above module to configure sidebar menu to have multi level as you would like.

mattypants's picture
mattypants
Thu, 03/24/2016 - 03:30

Ah ok, Will give it a try, thanks. To be clear I only want one level of links in the sidebar. For example, if I have the following menu:

  • Shape

    • Circle

      • Sun

      • Moon

    • Square

    • Rectangle

    • Triangle

  • Colour

  • Size

If I'm on page 'Circle', I only want to see the following (in the sidebar):

  • Circle

  • Square

  • Rectangle

  • Triangle

In other words, I don't need to see any nav child items in the sidebar. Do I still need to use the other module?

thanks again

phuonght's picture
phuonght
Thu, 03/24/2016 - 22:47

You could try to create customised static block then add HTML as below:

<ul class="menu">

      <li><a href="aboutus-basic.html">ABOUT US - BASIC</a></li>

      <li class="active"><a href="aboutus.html">ABOUT US</a></li>

      <li><a href="certifications.html">CERTIFICATIONS</a></li>

      <li><a href="history.html">COMPANY HISTORY</a></li>

       <li><a href="core-values.html">OUR CORE VALUES</a></li>

</ul>

By this way, you can insert, remove menu items without using other modules, also module nice_menu as we suggested above. 

mattypants's picture
mattypants
Fri, 03/25/2016 - 03:23

Static menus would be a huge job for a big website. I'd have to make maybe 100 different menus.

I'm just getting used to your theme and awecontent, trying to integrate a new module at this point might get confusing for me

I'll give it a try though.

mattypants's picture
mattypants
Fri, 03/25/2016 - 19:37

I disabled menu block, and installed Nice_Menu. Already I have multiple warning on admin pages. 

Questions:

  1.  Should the menu parent of Nice menu be the machine name of the sidebar menu I just created in Administration » Structure » Menus? The default is set to <navigation>

  2. How do I add links to the new sidebar menu I created?

phuonght's picture
phuonght
Fri, 03/25/2016 - 22:40

Please take a look at tutorial: https://www.youtube.com/watch?v=H4kEfxM6dfo

mattypants's picture
mattypants
Wed, 04/06/2016 - 13:51

So the first step is to disable the menu_block module, right? All I have done is disable the menu_block, and right away I get the famous warnings that I have seen so many times with this theme:

  • Warning: Invalid argument supplied for foreach() in element_children() (line 6541 of /home3/montreb2/public_html/d7/includes/common.inc).

  • Warning: Illegal string offset '#children' in drupal_render() (line 5998 of /home3/montreb2/public_html/d7/includes/common.inc).

  • Warning: Illegal string offset '#children' in drupal_render() (line 6008 of /home3/montreb2/public_html/d7/includes/common.inc).

  • Warning: Illegal string offset '#children' in drupal_render() (line 6046 of /home3/montreb2/public_html/d7/includes/common.inc).

  • Warning: Illegal string offset '#printed' in drupal_render() (line 6053 of /home3/montreb2/public_html/d7/includes/common.inc).

  • etc...

Why do these warnings show so often in this theme? Is there a way to actually know what the error is, instead of the same warnings each time?

phuonght's picture
phuonght
Thu, 04/07/2016 - 06:08

Sorry,

Which version of module field collection are you using in your site? 


mattypants's picture
mattypants
Thu, 04/07/2016 - 09:07

7.x-1.0-beta11

phuonght's picture
phuonght
Fri, 04/08/2016 - 06:58

So please downgrade to version beta 8 (https://www.drupal.org/node/2369003).

mattypants's picture
mattypants
Tue, 04/12/2016 - 20:44

I downgraded the field collection module to beta 8.

But I still get common.inc warnings when I disable the menu block module.

phuonght's picture
phuonght
Tue, 04/12/2016 - 22:27

So please try without disabling menu block module. 

mattypants's picture
mattypants
Tue, 04/12/2016 - 22:33

I want to use nice menu module, so I have to disable the menu block module. 

mattypants's picture
mattypants
Tue, 04/12/2016 - 23:04

Everything I want to do in this theme I get the common.inc errors, this is completely ridiculous...

I re-enabled the menu block, and created a new page, and AGAIN with these warnings:

  • Warning: Invalid argument supplied for foreach() in element_children() (line 6541 of /home3/montreb2/public_html/d7/includes/common.inc).

  • Warning: Illegal string offset '#children' in drupal_render() (line 5998 of /home3/montreb2/public_html/d7/includes/common.inc).

  • Warning: Illegal string offset '#children' in drupal_render() (line 6008 of /home3/montreb2/public_html/d7/includes/common.inc).

  • Warning: Illegal string offset '#children' in drupal_render() (line 6046 of /home3/montreb2/public_html/d7/includes/common.inc).

  • Warning: Illegal string offset '#printed' in drupal_render() (line 6053 of /home3/montreb2/public_html/d7/includes/common.inc).

  • Warning: Invalid argument supplied for foreach() in element_children() (line 6541 of /home3/montreb2/public_html/d7/includes/common.inc).

  • Warning: Illegal string offset '#children' in drupal_render() (line 5998 of /home3/montreb2/public_html/d7/includes/common.inc).

  • Warning: Illegal string offset '#children' in drupal_render() (line 6008 of /home3/montreb2/public_html/d7/includes/common.inc).

  • Warning: Illegal string offset '#children' in drupal_render() (line 6046 of /home3/montreb2/public_html/d7/includes/common.inc).

  • Warning: Illegal string offset '#printed' in drupal_render() (line 6053 of /home3/montreb2/public_html/d7/includes/common.inc).

  • ETC

phuonght's picture
phuonght
Wed, 04/13/2016 - 03:17

We fixed. Please check site.

mattypants's picture
mattypants
Wed, 04/13/2016 - 10:54

Thank you very much. What was causing the warnings?

phuonght's picture
phuonght
Wed, 04/13/2016 - 22:41

Please take note that we just need to remove menu block from page then it works normally. Also, we think we had an explanation for you at another topic in forum already. 

mattypants's picture
mattypants
Wed, 04/13/2016 - 23:18

Oh, do you mean this explanation? Thanks.

khoa's picture
khoa
Wed, 04/13/2016 - 23:35

Yes, that's it!

mattypants's picture
mattypants
Wed, 04/13/2016 - 23:39

That is the least helpful you could possibly be.

mattypants's picture
mattypants
Thu, 04/14/2016 - 02:02

Is the idea that if there are no child pages, then the sidebar menu should be removed?

phuonght's picture
phuonght
Thu, 04/14/2016 - 04:26

Mattypants,

It is the one we mentioned.

mattypants's picture
mattypants
Thu, 04/14/2016 - 22:06

I'm trying hard to understand most of your answers. Would the answer to my previous question be yes or no?

thanks

phuonght's picture
phuonght
Thu, 04/14/2016 - 22:11

Our answer is yes.

Thank you.

mattypants's picture
mattypants
Thu, 04/14/2016 - 22:20

Ok, I understand, thanks

Log in or register to post comments
Have More Idea?

We are here to build your website!

No Universal solution fits all special business requirements. Our experienced team is ready with ideas and state-of-the-art technical solutions to consult the best solution within your budget.