WebsiteBaker Support (2.12.x) > Modules
page_description in menu
johnbroeckaert:
Hello,
I use a seperate showmenu2 for the external links on a site and want to display not only the menu but also the page description.
This is the menu that i use
--- Code: --- show_menu2(
$aMenu = 2,
$aStart = SM2_ROOT,
$aMaxLevel = SM2_ALL,
$aOptions = SM2_ALL,
$aItemOpen = '<li><a href="[url]">[menu_title]<span>[page_description]</span></a>',
$aItemClose = '</li>',
$aMenuOpen = '<ul class="home-sidelinks">',
$aMenuClose = '</ul>',
$aTopItemOpen = false,
$aTopMenuOpen = false
);
?>
--- End code ---
It is only displaying the word page_desciption. what am i doing wrong?
thank you!
Gast:
very easy with a look into the readme ;-)
[description] is the right word
johnbroeckaert:
Thanks Uwe!
I looked it up on: https://help.WebsiteBaker.org/en/developerguide/variables-and-constants.php
and found this:
--- Code: ---PAGE_DESCRIPTION page description of actual page
--- End code ---
Where is the readme you are talking about?
Thanks again
John
johnbroeckaert:
euh.....
I was a bit to soon with the thank you :-D
tryed [description] but then it says: [description=UNKNOWN]
I tryed a code section with
--- Code: ---<?php echo page_description; ?>
--- End code ---
and it gave the right tekst :-P
Still don t know how to incorperate it in showmenu
CodeALot:
This is how to do it:
--- Code: --- show_menu2(
$aMenu = 2,
$aStart = SM2_ROOT,
$aMaxLevel = SM2_ALL,
$aOptions = SM2_ALLINFO|SM2_ALL,
$aItemOpen = '<li><a href="[url]">[menu_title]<span> - [description]</span></a>',
$aItemClose = '</li>',
$aMenuOpen = '<ul class="home-sidelinks">',
$aMenuClose = '</ul>',
$aTopItemOpen = false,
$aTopMenuOpen = false
);
--- End code ---
Note the SM2_ALLINFO and [description]
Without SM2_ALLINFO the constant [description ] will NOT be shown!
Navigation
[0] Message Index
[#] Next page
Go to full version