WebsiteBaker Community Forum

WebsiteBaker Support (2.12.x) => General Help & Support => Topic started by: svsanchez on April 19, 2021, 07:45:38 PM

Title: Show_menu2 adding strange code
Post by: svsanchez on April 19, 2021, 07:45:38 PM
Hello!

I am having a strange problem with SM2, which I am using for creating a list of pages inside of my categories via a CODE module.

This is what I have in the code module:

show_menu2(SM2_ALLMENU, SM2_CURR+1, SM2_CURR+1, SM2_ALL|SM2_ALLINFO, '<p><strong>[a][menu_title]</a>:</strong> [description]</p>', false, '');

This creates a list of subpages with their descriptions, like:

(https://cloud.screenpresso.com/G1Egc/2021-04-19_11h36_07.png)

Which is what I want, HOWEVER, when you see the source of the page, this is what it shows:

<a class="section_anchor" id="wb_5886" name="wb_5886"></a><p><strong><a href="https://www.deguate.com.gt/guatemala/agricultura/agroquimicos.php" title="Agroquímicos en Guatemala" target="_top">Agroquimicos</a>:</strong> Encuentre aquí empresas dedicadas a la elaboración, importación y comercialización de agroquímicos en Guatemala. Insecticidas, herbicidas, fungicidas, fertilizantes, etc.</p></li><p><strong><a href="https://www.deguate.com.gt/guatemala/agricultura/cafe.php" title="Café en Guatemala" target="_top">Café</a>:</strong> Directorio de empresas cafetaleras en Guatemala. Cultivo, compra, venta y exportación de café guatemalteco. Tosta, mezcla y venta de cafés finos y orgánicos.</p></li>

As you can see, there is a lot of code that I didn't include in the SM2 code, like:
- <a class="section_anchor" id="wb_5886" name="wb_5886"></a>
- the ending </li> tag

That particular ending </li> tag is appearing many times as an error on the w3 html validator, and I would like to know how to get rid of it.

Where can I do this?
Title: Re: Show_menu2 adding strange code
Post by: dbs on April 19, 2021, 08:12:58 PM
Hi, for code please use the code button # in the toolbar.

Your menu has only 6 parameters of 10. So show_menu fills the rest with the default parameters.
</p> should not be there

deafault:

Code: [Select]
<?php 
show_menu2
(
 
$aMenu 0,
 
$aStart SM2_ROOT,
 
$aMaxLevel SM2_CURR+1,
 
$aOptions SM2_TRIM,
 
$aItemOpen '[li][a][menu_title]</a>',
 
$aItemClose '</li>',
 
$aMenuOpen '[ul]',
 
$aMenuClose '</ul>',
 
$aTopItemOpen false,
 
$aTopMenuOpen false
 
)


in your case it could be

Code: [Select]
<?php
show_menu2
(SM2_ALLMENUSM2_CURR+1SM2_CURR+1SM2_ALL|SM2_ALLINFO'<p><strong>[a][menu_title]</a>:</strong> [description]''</p>'false,falsefalsefalse);
Title: Re: Show_menu2 adding strange code
Post by: svsanchez on April 19, 2021, 11:58:44 PM
Amazing! Thank you so much dbs!!!