Language Key Ponderable

I haven't found a way to do this yet..... if anyone has an idea, I'd sure appreciate it.  Below is a section of code in my BxTmplMenu.php file, which overrides the corresponding function in BxBaseMenu.php.  Note the code highlighted in red.




        $sMainSubs = ($sSubMenu=='') ? '' : <<<EOF
    <!--[if lte IE 6]><table id="mmm"><tr><td><![endif]-->
    <ul class="sub main_elements"><div id="subMenuHead">{$sText}</div>
        {$sSubMenu}
    </ul>
    <!--[if lte IE 6]></td></tr></table></a><![endif]-->
EOF;

        $this->sCode .= <<<EOF
<td class="top" {$sActiveStyle} {$sImgTabStyle}>
    <a href="{$sLink}" {$sOnclick} {$sTarget} class="top_link"><span class="down" {$sBoldStyle}>{$sPictureRep}{$sText}</span>
    <!--[if gte IE 7]><!--></a><!--<![endif]-->
    <div id="dropdownTwoColumn" style="position:relative;display:block;">{$sMainSubs}</div>
</td>
EOF;

 

The {$sText} represents the name of the list item for the drop down, ie Forums, Blogs, Photos, etc. 

What I need to do, is find a way to dynamically create a language key based on {$sText}, so that I can add custom text to each drop down menu.  Replacing {$sText} with <bx_text:_dropMenu_{$sText}/>  won't  work because it would basically be a language key nested within another language key, and won't parse.

The end result I hope for is shown below, except that 'FORUMS" would be replaced by the dynamically generated language key for each drop menu.

My opinions expressed on this site, in no way represent those of Boonex or Boonex employees.
Quote · 6 Sep 2012

What is the code that loads the variable $sText


Because that is where it would be done.

<bx_text:_dropMenu_{$sText}/> may not work but.

$sText = _t('_dropMenu_' . $sText); should work.


https://www.deanbassett.com
Quote · 6 Sep 2012

Thanks Deano,  I did this:


$aText = _t('_dropMenu_' . $sText);

        $sMainSubs = ($sSubMenu=='') ? '' : <<<EOF
    <!--[if lte IE 6]><table id="mmm"><tr><td><![endif]-->
    <ul class="sub main_elements"><div id="subMenuHead">{$aText}</div>
        {$sSubMenu}
    </ul>
    <!--[if lte IE 6]></td></tr></table></a><![endif]-->
EOF;

 

  Some day, I'll know what I'm doing.  I almost had it once, but I tried something like $aText = _t('_dropMenu_') . $sText; and it didn't work.

Anyway, It works!

 

My opinions expressed on this site, in no way represent those of Boonex or Boonex employees.
Quote · 6 Sep 2012
 
 
Below is the legacy version of the Boonex site, maintained for Dolphin.Pro 7.x support.
The new Dolphin solution is powered by UNA Community Management System.