[30]Allowing html in menu title

Locked
nico76
Joomla! Apprentice
Joomla! Apprentice
Posts: 9
Joined: Sat Mar 15, 2008 8:46 pm

[30]Allowing html in menu title

Post by nico76 » Tue Mar 18, 2008 2:10 pm

I think it can be useful to have some html (span tags etc.) in the menu title for am more sophisticated design.

Therefore I would like to suggest enabling or disabling the code cleaning function for the menu title in site configuration so that only a super administrator can make this decision.

So this function meets the need of a more design orientated aspect or a more secure aspect (when you have more people working in the backend).


This additional checkbox should make no problems for backward compatibility.

Markstein
Joomla! Hero
Joomla! Hero
Posts: 2268
Joined: Sat Feb 09, 2008 8:27 am
Location: California, USA

Re: [30]Allowing html in menu title

Post by Markstein » Mon Dec 29, 2008 9:18 pm

I totally agree with this. Being able to insert HTML into the joomla menu title would be GREAT!

I currently have a lot of Registered Trademark symbols in my menu, pages, etc. The symbols are all placed in html superscript tags and I have made a CSS class for the <sup> tags. This works great in the articles where I have control.

The menu has the Registered Trademark symbol as large as the rest of the text because there is no way to input HTML into the menu currently. Hopefully this will be an option in the future!

Mark

User avatar
infograf768
Joomla! Master
Joomla! Master
Posts: 19133
Joined: Fri Aug 12, 2005 3:47 pm
Location: **Translation Matters**

Re: [30]Allowing html in menu title

Post by infograf768 » Tue Dec 30, 2008 7:30 am

FYI ™ is a common glyph found in all current Internet fonts and one does not need to use superscript to get it. It is part of the "Letterlike symbols"

On Macintosh one uses Option-2 to get it.
You may copy the glyph from here and use without need for html



as for ® it is never used as sup

This is not to say that html should not be used in Titles, but one has to think of the code consequences which could be quite heavy as the alias is made from the Title.
Jean-Marie Simonet / infograf
---------------------------------
ex-Joomla Translation Coordination Team • ex-Joomla! Production Working Group

Markstein
Joomla! Hero
Joomla! Hero
Posts: 2268
Joined: Sat Feb 09, 2008 8:27 am
Location: California, USA

Re: [30]Allowing html in menu title

Post by Markstein » Tue Dec 30, 2008 6:08 pm

Code: Select all

as for ® it is never used as sup
Are you saying the correct way to use the Registered Trademark symbol ® is to "not" put it into superscript? I'm just curious!

MyProductName®

Doesn't look as good as

MyProductName®

in my opinion! Of course the ® is not vertically aligned to the top here as I dont have CSS control but you can see a description of what I am talking about by Clicking here

I think it looks more professional having it smaller and aligned to the top of the word. Perhaps I am indeed using it the wrong way! What are your thoughts?

User avatar
infograf768
Joomla! Master
Joomla! Master
Posts: 19133
Joined: Fri Aug 12, 2005 3:47 pm
Location: **Translation Matters**

Re: [30]Allowing html in menu title

Post by infograf768 » Tue Dec 30, 2008 6:44 pm

Wikipedia® is a registered trademark of the Wikimedia Foundation, Inc., a U.S. registered 501(c)(3) tax-deductible nonprofit charity.
Jean-Marie Simonet / infograf
---------------------------------
ex-Joomla Translation Coordination Team • ex-Joomla! Production Working Group

davydka
Joomla! Fledgling
Joomla! Fledgling
Posts: 2
Joined: Thu Oct 15, 2009 5:32 am
Contact:

Re: [30]Allowing html in menu title

Post by davydka » Sat Nov 21, 2009 8:00 pm

Code: Select all

<? 
// extra code to make this work
$style = -2; // set the style
$position = "top"; // set the position of the modules to be loaded
// end of extra code
				
$document   = &JFactory::getDocument();
$renderer   = $document->loadRenderer('module');
$params      = array('style'=>$style);
				
$contents = '';
foreach (JModuleHelper::getModules($position) as $mod)  {
$contents .= $renderer->render($mod, $params);
}
				
// this part allows html characters to show correctly
echo html_entity_decode($contents);
?>

User avatar
infograf768
Joomla! Master
Joomla! Master
Posts: 19133
Joined: Fri Aug 12, 2005 3:47 pm
Location: **Translation Matters**

Re: [30]Allowing html in menu title

Post by infograf768 » Sun Nov 22, 2009 6:29 am

???
Jean-Marie Simonet / infograf
---------------------------------
ex-Joomla Translation Coordination Team • ex-Joomla! Production Working Group

davydka
Joomla! Fledgling
Joomla! Fledgling
Posts: 2
Joined: Thu Oct 15, 2009 5:32 am
Contact:

Re: [30]Allowing html in menu title

Post by davydka » Sun Nov 22, 2009 4:02 pm

If you use the above code instead of <jdoc:include type="modules" name="top" />, it will correctly display any span tags, etc, that you put in your menu title.

User avatar
infograf768
Joomla! Master
Joomla! Master
Posts: 19133
Joined: Fri Aug 12, 2005 3:47 pm
Location: **Translation Matters**

Re: [30]Allowing html in menu title

Post by infograf768 » Sun Nov 22, 2009 6:34 pm

It does work OK indeed. :)
But one has better take care of the automatic alias created.

EDIT: And pathway looks weird too...
Jean-Marie Simonet / infograf
---------------------------------
ex-Joomla Translation Coordination Team • ex-Joomla! Production Working Group


Locked

Return to “Under Review - Archived”