hi,<br><br>I&#39;m surprised, i did not receive any response... while i am sure, the code below is not very nice ;-)<br><br>any idea to help me do that in a good and correct Drupal way please ?<br><br>Cédric<br><br><div class="gmail_quote">
---------- Forwarded message ----------<br>From: <b class="gmail_sendername">Cédric Joubert</b> <span dir="ltr">&lt;<a href="mailto:cedjoubert@gmail.com">cedjoubert@gmail.com</a>&gt;</span><br>Date: 2010/3/6<br>Subject: How to add comment under menu items<br>
To: <a href="mailto:development@drupal.org">development@drupal.org</a><br><br><br>





<div bgcolor="#ffffff">
<div><font face="Arial" size="2">Hi,</font></div>
<div><font face="Arial" size="2"></font> </div>
<div><font face="Arial" size="2">I&#39;m new on Drupal and I would like to know how can 
I make properly such comment on items Menu please ?</font></div>
<div><font face="Arial" size="2"> -&gt; each first row is a link and each 2nd 
row is a comment...</font></div>
<div><font face="Arial" size="2"></font> </div>
<div><font face="Arial" size="2">- Menu 1</font></div>
<div><font face="Arial" size="2">  (my explanation)</font></div>
<div>
<div><font face="Arial" size="2"></font> </div>
<div><font face="Arial" size="2">- Menu 2</font></div>
<div><font face="Arial" size="2">  (other explanation ...)</font></div>
<div><font face="Arial" size="2">...</font></div>
<div><font face="Arial" size="2"></font> </div>
<div><font face="Arial" size="2">The only solution i&#39;ve found is to do that 
(below)... but i&#39;m sure it&#39;s not a property way...</font></div>
<div><font face="Arial" size="2">- the only constraint i have is to have the 
abbility to get the Description field in the underlying menu to display a 
dynamic comment.</font></div>
<div><font face="Arial"><font size="2">but actually, the only trick I&#39;ve found to 
get the Description is to parse the HTML string to retrieve the &quot;<span>title&quot; tag to get my text.</span></font></font></div>
<div><font face="Arial"><font size="2"><span>Not very cool, i 
think...</span></font></font></div>
<div><font face="Arial"><font size="2"><span>- actually, to 
determine the underlying nodes menu, i&#39;m testing her names... is there another 
way to do that ?</span></font></font></div>
<div><font face="Arial" size="2"></font> </div>
<div><font face="Arial" size="2">Can you help me please ?</font></div>
<div><font face="Arial" size="2"></font> </div>
<div><font face="Arial" size="2">Regards</font></div>
<div><font face="Arial" size="2">Cédric</font></div>
<div><font face="Arial" size="2"></font> </div>
<div><font face="Arial" size="2"></font> </div>
<div><font face="Arial" size="2">function myTheme_menu_item(</font><font face="Arial" size="2">$link, $has_children, $menu = &#39;&#39;, $in_active_trail = FALSE, $extra_class 
= NULL) {<br>  $class = ($menu ? &#39;expanded&#39; : ($has_children ? &#39;collapsed&#39; 
: &#39;leaf&#39;));<br>  if (!empty($extra_class)) {<br>    $class 
.= &#39; &#39;. $extra_class;<br>  }<br>  if ($in_active_trail) 
{<br>    $class .= &#39; active-trail&#39;;<br>  }<br>  $css_id 
= strip_tags($link);<br>  </font></div>
<div><font face="Arial" size="2">  // test the node for which i want to 
add comment<br>  if (stripos($link, &#39;MyMenu1&#39;) &gt; 0 || stripos($link, 
&#39;MyMenu2&#39;) &gt; 0) {<br>    $rec = 
&#39;title=&quot;&#39;;<br>    $i = stripos($link, 
$rec);<br>    if ($i &gt; 0) 
{<br>       $j = strpos($link, &#39;&quot;&#39;, 
$i+strlen($rec));<br>       if ($j &gt; 
0)<br>         $title = substr($link, 
$i+strlen($rec), $j-$i-strlen($rec));<br>    }  <br>  
}<br>  <br>  $title = ($title != &quot;&quot;) ? &#39;&lt;div 
class=&quot;views-field-created&quot;&gt;&lt;h0&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;[&#39; 
. $title . &#39;]&lt;/h0&gt;&lt;/div&gt;&#39; : &#39;&#39;;<br>  return &#39;&lt;li class=&quot;&#39;. 
$class .&#39;&quot;&gt;&#39;. $link . $menu .&quot;&lt;/li&gt;\n&quot; . 
$title;<br>}<br></font></div></div></div>
</div><br>