Custom icons using JToolBarHelper::title

For Joomla! 1.5 Coding related discussions, please use: http://groups.google.com/group/joomla-dev-general
Locked
User avatar
tfuller
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 218
Joined: Tue Sep 20, 2005 11:30 pm
Location: Oregon
Contact:

Custom icons using JToolBarHelper::title

Post by 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();
$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?
Author of component Joomla Bible Study:
http://www.JoomlaBibleStudy.org

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

Re: Custom icons using JToolBarHelper::title

Post by 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.

Ian

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

Re: Custom icons using JToolBarHelper::title

Post by 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' );


Locked

Return to “Joomla! 1.5 Coding”