WebsiteBaker Community Forum

WebsiteBaker Support (2.8.x) => Templates, Menus & Design => Topic started by: Craxx on April 29, 2010, 10:38:43 AM

Title: show_menu2 error: $aOptions is invalid. No flags from group 1 supplied!
Post by: Craxx on April 29, 2010, 10:38:43 AM
Hy,

i get in the cgi_error.log the following error:
show_menu2 error: $aOptions is invalid. No flags from group 1 supplied!

How can i get rid off that?

best regards
Craxx;)
Title: Re: show_menu2 error: $aOptions is invalid. No flags from group 1 supplied!
Post by: Argos on May 03, 2010, 09:53:09 AM
Hy,

i get in the cgi_error.log the following error:
show_menu2 error: $aOptions is invalid. No flags from group 1 supplied!

How can i get rid off that?


Not sure what you mean with cgi_error.log, but there must be an error in your menu call. Check http://www.websitebakers.de/sm2/
Title: Re: show_menu2 error: $aOptions is invalid. No flags from group 1 supplied!
Post by: Craxx on May 03, 2010, 12:51:36 PM
Hy Argos,

thx for answer. I looked in docu, but cannot see the error...? Could you please help. Here is my index.php from template:

Code: [Select]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>
<?php page_title(); ?>
</title>
<meta http-equiv="Content-Type" content="text/html; charset=<?php if(defined(&#39;DEFAULT_CHARSET&#39;)) { echo DEFAULT_CHARSET; } else { echo &#39;utf-8&#39;; }?>" />
<meta name="description" content="<?php page_description(); ?>" />
<meta name="keywords" content="<?php page_keywords(); ?>" />
<link rel="stylesheet" type="text/css" media="screen,projection" href="<?php echo TEMPLATE_DIR?>/layout4_setup.css" />
<link rel="stylesheet" type="text/css" media="screen,projection" href="<?php echo TEMPLATE_DIR?>/layout4_text.css" />
<link rel="stylesheet" type="text/css" href="<?php echo TEMPLATE_DIR?>/print.css" media="print" />
<title>???</title>
</head>
<!-- Global IE fix to avoid layout crash when single word size wider than column width -->
<!--[if IE]><style type="text/css"> body {word-wrap: break-word;}</style><![endif]-->
<body>
<body>
<!-- Main Page Container -->
<div class="page-container">
<!-- For alternative headers START PASTE here -->
<!-- A. HEADER -->
<div class="header">
  <!-- A.2 HEADER MIDDLE -->
  <div class="header-middle">
    <!-- Site message -->
    <div class="sitemessage"> </div>
  </div>
  <!-- A.3 HEADER BOTTOM -->
  <div class="header-bottom">
    <div class="nav2">
      <!-- Navigation item -->
<?php if(SHOW_MENU) { /* Only shown menu if we need to */ ?>
    <?php show_menu2(0SM2_ROOTSM2_STARTSM2_PRETTY, &#39;<li [if(class==menu-current){id="menu-current"}]>[a]<span>[menu_title]</span></a>&#39;); ?>
    <?php ?>
    </div>
  </div>
<!--   </div>  -->
  <!-- B. MAIN -->
  <div class="main">
    <!-- B.1 MAIN NAVIGATION -->
    <div class="main-navigation">
      <!-- Navigation Level 3 -->
      <div class="round-border-topright"></div>
 <h1 class="first">&Uuml;bersicht</h1>
      <!-- Navigation with grid style -->
 <?php show_menu2(0,      SM2_ROOT+1SM2_CURR+1SM2_PRETTY, &#39;<dt>[a][menu_title]</a>&#39;, &#39;</dt>&#39;, &#39;<dl class="nav3-grid">&#39; , &#39;</dl>&#39;);?>
 
<br><br>
    <div class="searchform">
      <?php if(SHOW_SEARCH) { /* Only show search box if search is enabled */ ?>
      <fieldset>
      <form name="search" action="<?php echo WB_URL?>/search/index<?php echo PAGE_EXTENSION?>" method="post" class="field" />
      <input value="" name="string" class="field" />
      <input type="submit" value="Suchen" name="submit" />
      </fieldset>
      </form>
      <?php ?>
    </div>
 
      <!-- Template infos -->
       <?php
        
if(FRONTEND_LOGIN == &#39;enabled&#39; AND VISIBILITY != &#39;private&#39; AND $wb->get_session(&#39;USER_ID&#39;) == &#39;&#39;) {
        
?>

      <form name="login" action="<?php echo LOGIN_URL?>" method="post" class="login_table">
        <h1><?php echo $TEXT[&#39;LOGIN&#39;]; ?></h1>
        <p><?php echo $TEXT[&#39;USERNAME&#39;]; ?>:</p>
        <p><input type="text" name="username" style="text-transform: lowercase;" /></p>
        <p><?php echo $TEXT[&#39;PASSWORD&#39;]; ?>:</p>
        <p><input type="password" name="password" /></p>
        <p><?php if(is_numeric(FRONTEND_SIGNUP)) { ?>
        <a href="<?php echo SIGNUP_URL?>"><?php echo $TEXT[&#39;SIGNUP&#39;]; ?></a>
        <?php ?></p>
      </form>
      <?php
        
} elseif(FRONTEND_LOGIN == &#39;enabled&#39; AND is_numeric($wb->get_session(&#39;USER_ID&#39;))) {
        
?>

      <p><form name="logout" action="<?php echo LOGOUT_URL?>" method="post" class="login_table"></p>
        <h1><?php echo $TEXT[&#39;LOGGED_IN&#39;]; ?></h1>
        <p><?php echo $TEXT[&#39;WELCOME_BACK&#39;]; ?>, <?php echo $wb->get_display_name(); ?> <br /></p>
        <p><input type="submit" name="submit" value="<?php echo $MENU[&#39;LOGOUT&#39;]; ?>" /><p>
      <p><a href="<?php echo PREFERENCES_URL?>"><?php echo $MENU[&#39;PREFERENCES&#39;]; ?></a></p><p> <a href="<?php echo ADMIN_URL?>/index.php"><?php echo $TEXT[&#39;ADMINISTRATION&#39;]; ?></a></p>
      </form>
<p><a href="javascript:window.print()">Diese Seite drucken</a></p>
      <p><?php frontend_edit(); ?></p>
      <p><a href="<?php echo ADMIN_URL?>/index.php" target="_blank"><?php echo "Administration der Website" ?></p>
      <?php
        
}
        
?>

    </div>
    <!-- B.2 MAIN CONTENT -->
    <div class="main-content">
      <!-- Pagetitle -->
      <br>
      <h1 class="pagetitle"><?php echo PAGE_TITLE?></h1>
      <!-- Content unit - One column -->
      <div class="column1-unit">
         <?php page_content(); ?>
      </div>
    </div>


  <!-- C. FOOTER AREA -->  
  <div class="footer">
    <p><?php page_footer(); ?></p>
    <p class="credits">designed by Administrator und Webmaster <a href="http://www.???.com" target="_blank"><?php echo "???" ?></a></p>
  </div>
</div>
</body>
</html>


THX and best regards
Craxx;)
Title: Re: show_menu2 error: $aOptions is invalid. No flags from group 1 supplied!
Post by: Argos on May 03, 2010, 01:01:03 PM
You have 2 menu calls:

Code: [Select]
<?php show_menu2(0SM2_ROOTSM2_STARTSM2_PRETTY, &#39;<li [if(class==menu-current){id="menu-current"}]>[a]<span>[menu_title]</span></a>&#39;); ?>
Code: [Select]
<?php show_menu2(0SM2_ROOT+1SM2_CURR+1SM2_PRETTY, &#39;<dt>[a][menu_title]</a>&#39;, &#39;</dt>&#39;, &#39;<dl class="nav3-grid">&#39; , &#39;</dl>&#39;);?>
One of them or both generate the error. Please look in the menu docu what part of the menu(s) $aOptions exactly is, and correct the call. I don't have time right now to investigate for you. But there must be something wrong with your menu call(s). Investigate by using elementary calls first, like

Code: [Select]
<?php show_menu2(0); ?>
to see what menu is wrong.
Title: Re: show_menu2 error: $aOptions is invalid. No flags from group 1 supplied!
Post by: Craxx on May 03, 2010, 03:11:06 PM
Hy Argos,

thx for answer and tipp. On bothe there is an error with SM2_PRETTY. There is no error with:

<?php show_menu2(0, SM2_ROOT, SM2_START); ?>    

-> The Menu on top is ok!!!

and

<?php show_menu2(0,      SM2_ROOT+1, SM2_CURR+1);?>

-> The Menue on the left side is not correct formatted.

But it is an error when i write
<?php show_menu2(0, SM2_ROOT+1, SM2_CURR+1, '<dt>[a][menu_title]</a>', '</dt>', '<dl class="nav3-grid">' , '</dl>');?>


The original Template is Multiflex-1 and i modified it for me. When i use the Multiflex-1 Template i have same errors.
Please can you give me another tipp.

THX and best regards
Craxx;)
Title: Re: show_menu2 error: $aOptions is invalid. No flags from group 1 supplied!
Post by: BerndJM on May 04, 2010, 01:28:50 AM
O.k.

let's have a lookm into the readme file:


$aOptions 
Specify flags for different generation options for the menu. The flags
may be combined together using bitwise OR (|). For example, to specify
both TRIM and PRETTY you should use, (SM2_TRIM | SM2_PRETTY).

GROUP 1
-------
Exactly one flag from this group must always be supplied. These flags
affect how the siblings in the tree are removed from the output.
   
GROUP 2
-------
All of these flags are optional. Any number of them may be combined.

Regards Bernd
Title: Re: show_menu2 error: $aOptions is invalid. No flags from group 1 supplied!
Post by: Craxx on May 04, 2010, 07:59:20 AM
Hello Bernd,

thx for answer. Yes i read that in readme, but did you read my post? I have no error, when there is only


<?php show_menu2(0, SM2_ROOT, SM2_START); ?>    

and

<?php show_menu2(0,      SM2_ROOT+1, SM2_CURR+1);?>

Only when there is

<?php show_menu2(0, SM2_ROOT+1, SM2_CURR+1, '<dt>[a][menu_title]</a>', '</dt>', '<dl class="nav3-grid">' , '</dl>');?>

there is an error.

Here you can see my work:
http://www.anglerbund-ansbach.de/wb/

I am a rookie in programming and the first problem ist that the original template has the same problem. Perhaps somebody could help me. Here is the original template:

http://www.websitebaker2.org/template/pages/templates.php?id=73&Keywords=multiflex

THX a lot and best regards
Craxx;)
Title: Re: show_menu2 error: $aOptions is invalid. No flags from group 1 supplied!
Post by: Argos on May 04, 2010, 08:54:22 AM
Try replacing <dt> and </dt> with <li> and </li>
And replacing <dl> and </dl> with <ul> and </ul>

Don't forget modifying your stylesheet.

And try to get rid of the errors, your site doesn't validate. See http://validator.w3.org/

I wouldn't mind too much though, the menu seems to be working fine.
Title: Re: show_menu2 error: $aOptions is invalid. No flags from group 1 supplied!
Post by: DarkViper on May 04, 2010, 11:19:34 AM
Code: (your code) [Select]
<?php show_menu2(0SM2_ROOT+1SM2_CURR+1, &#39;<dt>[a][menu_title]</a>&#39;, &#39;</dt>&#39;, &#39;<dl class="nav3-grid">&#39; , &#39;</dl>&#39;);?>
your call of 'show_menu' is definitely wrong.

take a look to the definition. and do not forget the simple math.-rules about brackets.

Code: [Select]
<?php  show_menu2( [$aMenu,[$aStart,[$aMaxLevel,[$aOptions,[$aItemOpen,[$aItemClose,[$aMenuOpen,[$aMenuClose,[$aTopItemOpen,[$aTopMenuOpen]]]]]]]]]] ); ?>
Title: Re: show_menu2 error: $aOptions is invalid. No flags from group 1 supplied!
Post by: BerndJM on May 04, 2010, 08:28:46 PM
Again the f**** manual:

$aMenu will be 0 for most people.

$aStart must be either a page ID or a value starting with "SM2_".

$aMaxLevel must be only values that start with "SM2_".

$aOptions must be only values that start with "SM2_" (unless you are
in a very small minority of users).

All other parameters are the HTML tag templates that will be
output for menus and menu items.

What this mean in your case?
Code: [Select]
$aMenu = 0,
$aStart = SM2_ROOT+1,
$aMaxLevel =  SM2_CURR+1,
$aOptions = '<dt>[a][menu_title]</a>'
You have the HTML-Syntax for $aItemOpen as $aOptions ...

Regards Bernd
Title: Re: show_menu2 error: $aOptions is invalid. No flags from group 1 supplied!
Post by: Craxx on May 05, 2010, 08:36:59 AM
Oh oh oh thx a lot for your advice.... So i hope to get that in the right way. I will take my time to change and test values. Hope i can ask when i am too rookie to get that in the right way.....

thx a lot and best regards
Craxx;)
Title: Re: show_menu2 error: $aOptions is invalid. No flags from group 1 supplied!
Post by: Craxx on July 27, 2010, 11:41:20 AM
After a long time i have to less time and much more less knowledge to correct the template.

HMMM, perhaps it is possible for the cracks to correct my template in a few minutes. Please help me...
Tell me a price, i will pay for it:)

THX a lot:)
Craxx;)
Title: Re: show_menu2 error: $aOptions is invalid. No flags from group 1 supplied!
Post by: Craxx on July 28, 2010, 04:31:07 PM
It is solved - erpe helped me. THX a lot:)

best regards
Craxx;)
Title: Re: show_menu2 error: $aOptions is invalid. No flags from group 1 supplied!
Post by: Tomno399 on July 01, 2016, 09:05:24 AM
I am really glad that ERPE helped you. But what shall we other do? My server logfile is filled with this errors and ich would like to change it clean but I am not a coder. What shall I do?

In the template "Sobresot" I have more than one call of the show_menu2, but I don't know which one (or more?) is wrong:

Code: [Select]
show_menu2(0, SM2_ROOT, SM2_CURR, SM2_CRUMB, '<span class="[class]"> &raquo; [a][menu_title]</a></span>', '', '', '', ''.$breadcrumbstart.' &raquo; <span class="[class]">[a][menu_title]</a></span>');
Code: [Select]
show_menu2(1, SM2_ROOT+1, SM2_ALL, SM2_ALL, '<li class="[class]"><a href="[url]" target=[target] class="[class]"><span>[menu_title]</span></a>', "</li>", '<ul>', '</ul>', true, '<ul id="topmenu" class="nav sm sm-clean">');
Code: [Select]
show_menu2(1, SM2_CURR+1, SM2_CURR+1, '', '<li class="[class]">[a][menu_title]</a></li>', '', '', '', '');
And how can I repair it?


Title: Re: show_menu2 error: $aOptions is invalid. No flags from group 1 supplied!
Post by: dbs on July 01, 2016, 11:15:34 AM
Hi, in your third code is the 4th parameter missing.
Try SM2_TRIM
Code: [Select]
show_menu2(1, SM2_CURR+1, SM2_CURR+1, 'SM2_TRIM', '<li class="[class]">[a][menu_title]</a></li>', '', '', '', '');
Title: Re: show_menu2 error: $aOptions is invalid. No flags from group 1 supplied!
Post by: Tomno399 on July 01, 2016, 02:22:14 PM
Done - with aposthrophe ' xxx '?

Thank you dbs, I will have a look tomorrow on the server logfile and post it here.

Tom
Title: Re: show_menu2 error: $aOptions is invalid. No flags from group 1 supplied!
Post by: Gast on July 01, 2016, 02:36:36 PM
Done - with aposthrophe ' xxx '?

without apostrophe!
Title: Re: show_menu2 error: $aOptions is invalid. No flags from group 1 supplied!
Post by: dbs on July 01, 2016, 03:10:46 PM
Ooops, jacobi22 is right.
Title: Solved: show_menu2 error: $aOptions is invalid. No flags from group 1 supplied!
Post by: Tomno399 on July 03, 2016, 05:28:10 AM
Without aposthropes = no more error messages!

Thank you dbs, thank you jacobi22!
Title: Re: show_menu2 error: $aOptions is invalid. No flags from group 1 supplied!
Post by: Gast on August 03, 2016, 11:42:13 AM
please read the instructions for this module, both menu's are incomplete
Quote
GROUP 1
    -------
    Exactly one flag from this group must always be supplied. These flags
    affect how the siblings in the tree are removed from the output.

   SM2_ALL or
   SM2_TRIM or
   SM2_CRUMB or
   SM2_SIBLING

here an example
Code: [Select]
<?php show_menu2(0SM2_ROOT+1SM2_CURR+1SM2_ALL|SM2_PRETTY'<dt>[a][menu_title]</a>''</dt>''<dl class="nav3-grid">' '</dl>'); ?>
Title: Re: show_menu2 error: $aOptions is invalid. No flags from group 1 supplied!
Post by: Hans on February 13, 2017, 04:07:52 PM
Hi jacobi22

I find it very, very hard to understand the working of show_menu2. E.g.
I can't find anything wrong in this code:
Code: [Select]
<?php show_menu2(0SM2_ROOTSM2_ALLSM2_ALL|SM2_PRETTY'<li><a href="[url]" class="[class]"><span>[menu_title]</span></a>'"</li>"'<ul>'"</ul>"true'<ul id="main-menu" class="sm sm-mint">' '</ul>'); ?>
But I keep getting
Quote
[13-Feb-2017 14:44:42 Etc\/UTC] show_menu2 error: $aOptions is invalid. No flags from group 1 supplied!"

In my humble opinion my code is equal to the code you provided (except specific elements of course). Being a little bit dyslectic I can imagine that I don't see something wrong but after looking for what seems the 1000th time time I really can't get a solution for the error message.

Hope you can get me on the right path ;-)
Title: Re: show_menu2 error: $aOptions is invalid. No flags from group 1 supplied!
Post by: Gast on February 13, 2017, 04:41:17 PM
do you have more Show_menu2-Call's in your template?

the menu from your last posting produce no errors

look to the fourth place in the menu call

show_menu2(0, SM2_ROOT, SM2_ALL, SM2_ALL|SM2_PRETTY,

#1 = Number of the menu / Menu-ID
#2 = Start-Level
#3 = max Level
#4 =  Option

Option has two groups -

Group1: () Exactly one flag from this group must always be supplied.
SM2_ALL        or
SM2_TRIM      or
SM2_CRUMB   or
SM2_SIBLING

Group2 are optional
Title: Re: show_menu2 error: $aOptions is invalid. No flags from group 1 supplied!
Post by: Hans on February 13, 2017, 08:08:26 PM
Quote
do you have more Show_menu2-Call's in your template?

YES!
Didn't think about it. Will see and test, but I am confident that the errors are gone after that. Thank you!
Title: Re: show_menu2 error: $aOptions is invalid. No flags from group 1 supplied!
Post by: Hans on February 13, 2017, 08:15:44 PM
Quote
do you have more Show_menu2-Call's in your template?

YES!
Didn't think about it. Will see and test, but I am confident that the errors are gone after that. Thank you!

UPDATE: YES! Everything works without errors. Thanks again.
Title: Re: show_menu2 error: $aOptions is invalid. No flags from group 1 supplied!
Post by: Gast on February 13, 2017, 08:18:58 PM
 (Y) (Y)