Page 1 of 1
modifying menumanager not to encode HTML entities
Posted: Sun Nov 02, 2008 11:53 pm
by zsero
I am trying to implement highlighted styling for specific menu items, described in that thread:
http://forum.cmsmadesimple.org/index.ph ... 812.0.html
I think since its not really a design question I might get better response here. What do you think its easier to let menumanager not convert HTML entities into encoded characters, or look for a smarter solution?
Re: modifying menumanager not to encode HTML entities
Posted: Mon Nov 03, 2008 12:05 am
by calguy1000
This is simple, it's a one line change
find the line in MenuManager/MenuManager.module.php like:
Code: Select all
$onenode->menutext = my_htmlentities($content->MenuText());
and directly below it add:
Code: Select all
$onenode->raw_menutext = $content->MenuText();
then use
in your menumanager templates.
Re: modifying menumanager not to encode HTML entities
Posted: Mon Nov 03, 2008 1:32 am
by zsero
Thank you Calguy!
I didn't think it could be as easy as this!
Now I have a 100% identical code to my older version, but have the ability to upgrade from 1.2.5 to 1.4.1!
Re: modifying menumanager not to encode HTML entities
Posted: Wed Feb 25, 2009 2:39 pm
by joecannes
QUestion;
I am the opposite, where I need HTML entities in my menu text. Do I:
1. Take out
Code: Select all
$onenode->raw_menutext = $content->MenuText();
in MenuManager.module.php?
and do I need to modify my menu template? This is my menu template:
Code: Select all
{if $count > 0}
<ul class="nav">
{foreach from=$nodelist item=node}
{if $node->depth > $node->prevdepth}
{repeat string="<ul class=\"nav2\">" times=$node->depth-$node->prevdepth}
{elseif $node->depth < $node->prevdepth}
{repeat string="</li></ul>" times=$node->prevdepth-$node->depth}
</li>
{elseif $node->index > 0}</li>
{/if}
{if $node->current == true}
<li class="currentpage"><a class="activeparent" href="{$node->url}" title="{$node->menutext}">{$node->menutext}</a>
{elseif $node->parent == true}
<li class="activeparent"><a class="activeparent" href="{$node->url}"{if $node->accesskey != ''} accesskey="{$node->accesskey}"{/if}{if $node->tabindex != ''} tabindex="{$node->tabindex}"{/if}{if $node->titleattribute != ''} title="{$node->titleattribute}"}"{else} title="{$node->menutext}"{/if}>{$node->menutext}</a>
{elseif $node->type == 'sectionheader'}
<li class="sectionheader"><h2 class="nav">{$node->menutext}</h2>
{elseif $node->type == 'separator'}
<li class="separator" style="list-style-type: none;"> <hr />
{else}
<li><a href="{$node->url}"{if $node->accesskey != ''} accesskey="{$node->accesskey}"{/if}{if $node->tabindex != ''} tabindex="{$node->tabindex}"{/if}{if $node->titleattribute != ''} title="{$node->titleattribute}"{else} title="{$node->menutext}"{/if}{if $node->target != ''} target="{$node->target}"{/if}>{$node->menutext}</a>
{/if}
{/foreach}
{repeat string="</li></ul>" times=$node->depth-1}</li>
</ul>
{/if}
Re: modifying menumanager not to encode HTML entities
Posted: Wed Feb 25, 2009 4:35 pm
by NaN
None of them.
HTML-Enities will be by default.
You only need to change if you want something "special".
If you didn't insert or change something you don't need to remove something or undo changes.
That's kind of logic isn't it
