Page 1 of 1

Custom icons using JToolBarHelper::title

Posted: Thu Sep 20, 2007 1:38 am
by tfuller
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();
$document->addStyleSheet('administrator/components/com_biblestudy/css/general.css');
Then:

Code: Select all

.icon-48-generic {
background-image:url(../images/header/openbible.gif);
}
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?

Re: Custom icons using JToolBarHelper::title

Posted: Thu Sep 20, 2007 2:50 am
by ianmac
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.

Ian

Re: Custom icons using JToolBarHelper::title

Posted: Thu Jul 30, 2009 11:06 pm
by steve7642
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' );