Custom icons using JToolBarHelper::title

For Joomla! 1.5 Coding related discussions, please use:
Forum rules
Please use the mailing list here: rather than this forum.
User avatar
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 218
Joined: Tue Sep 20, 2005 11:30 pm
Location: Oregon

Custom icons using JToolBarHelper::title

Postby tfuller » Thu Sep 20, 2007 1:38 am

I'm confused by how to use my own icon in an admin menu. It appears that i need to use some CSS but not sure exactly the procedure.

I've got this in my view.html.php:

Code: Select all

$document =& JFactory::getDocument();


Code: Select all

.icon-48-generic {

In my general.css file.

Then back to view.html.php:

Code: Select all

JToolBarHelper::title(   JText::_( 'Books Manager' ), 'generic.png' );

Just shows the generic.png in my admin toolbar.

Any advice?
Author of component Joomla Bible Study:

User avatar
Joomla! Virtuoso
Joomla! Virtuoso
Posts: 4785
Joined: Sat Sep 24, 2005 11:01 pm
Location: Toronto, Canada

Re: Custom icons using JToolBarHelper::title

Postby ianmac » Thu Sep 20, 2007 2:50 am

Try changing generic to something else.  i.e. myspecialicon or openbible.png.  Your style might get overwritten by the Joomla! default, depending on the order it gets loaded.


Joomla! Fledgling
Joomla! Fledgling
Posts: 4
Joined: Mon Jul 20, 2009 10:05 pm

Re: Custom icons using JToolBarHelper::title

Postby steve7642 » Thu Jul 30, 2009 11:06 pm

When I used addStyleSheet, it did not work for some reason.. so I did the following which did work:

$doc =& JFactory::getDocument();
$style = " .icon-48-fb {background-image:url(components/com_formbuilder/fb.gif); no-repeat; }";
$doc->addStyleDeclaration( $style );

JToolBarHelper::title( JText::_( 'Generalized Form Builder     ' ), 'fb.gif' );

Return to “Joomla! 1.5 Coding”

Who is online

Users browsing this forum: No registered users and 5 guests