Aliro Documentation : Tooltips

HomePage :: Categories :: PageIndex :: RecentChanges :: RecentlyCommented :: Login/Register

Revision [1215]

Most recent edit made on 2010-01-06 00:35:32 by ChadAuld

Additions:
The YUI.ALIRO.COREUI JavaScript class provides functionality for creating system tooltips. Tooltips can be created using PHP or JavaScript.
A common use case for tooltips is the creation of the them in reference to an inline mouseover event. Since there are some scope complexities involved with such an action there is another convenience method you should rely on for performing this task called "displayAdvTooltip". Here is an example:
In older versions of Mambo, MiaCMS, Joomla overLib was used to create tooltips. You can still utilize overLib with Aliro if you'd like, but you'll need to include and manage it as a separate library within your extension. It is not bundled in the core any longer and the core functions related to it have been removed. To cut down on 3rd party dependencies and maintain a consist/enterprise grade system all core UI elements are built on top of the Yahoo! User Interface Library (YUI). You are not required to utilize YUI in your custom extensions, but we do recommend it.


Deletions:
The YUI.ALIRO.COREUI JavaScript class provides functionality for creating system tooltips. Tooltips can be created using PHP or JavaScript. The PHP method will ultimately setup the JavaScript for you.
A common use case for tooltips is the creation of the them in reference to an inline mouseover event. Since there are some scope complexities involved with such and action their is another convience method you should rely on for performing this task called "displayAdvTooltip". Here is an example:
In older versions of Mambo, MiaCMS, Joomla overLib was used to create tooltips. You can still utilize overLib with Aliro if you'd like, but you'll need to include/manage it as a separate library within your extension. It is not bundled in the core any longer and the core functions related to it have been removed. To cut down on 3rd party dependencies and maintain a consist/enterprise grade system all core UI elements are built on top of the Yahoo! User Interface Library (YUI). You are not required to utilize YUI, but we do recommend it.




Revision [1214]

Edited on 2010-01-06 00:31:51 by ChadAuld

Additions:
 
(html)
 
(php)
%%(css)


Deletions:
(language-ref)
(language-ref)
%%(language-ref)




Revision [1213]

Edited on 2010-01-06 00:28:08 by ChadAuld

Additions:

Advanced Tooltips with JavaScript

Styling Tooltips

Tooltips rely on the YUI overlay widget under the hood. A single div with the id of "aliro_tooltip_container" is used as a container for all tooltips. To target a tooltips for styling you'll need to use CSS selectors with a combination of aliro_tooltip_container and various YUI related classes. The default admin and at_galley templates both contain some basic tooltip selectors for reference. Here are the basics used to generate the screenshots displayed above:
#aliro_tooltip_container .yui-overlay-content {
border: 1px solid #000;
background-color: #aaa;
margin: 0 3px;
padding: 2px;
}
#aliro_tooltip_container .yui-overlay-content .yui-widget-hd {
background: none;
background-color: #222;
color: white;
font-size: 1.25em;
font-weight: bold;
text-align: center;
line-height: 1;
padding: 5px;
}
#aliro_tooltip_container .yui-overlay-content .yui-widget-bd {
text-align: left;
padding: 10px;
background-color: #F9EF90;
}
#aliro_tooltip_container .yui-overlay-content .yui-widget-ft {
text-align: left;
padding: 3px;
background-color: #222;
color: white;
}


Deletions:

Advanced Tooltip





Revision [1212]

Edited on 2010-01-06 00:20:08 by ChadAuld

Additions:

Tooltip from Markup with PHP

To create a basic tooltip using PHP you can make use of the aliroHTML::toolTip() method. Here is a simple example
Here is a screenshot of that tooltip in action:
tooltip
If you need more control over the tooltip you might try setting one up with JavaScript. You can call the same JavaScript method used under the hood by aliroHTML::toolTip(), but with the added benefits of being more specific and not being tied to a specific DOM structure. The YUI.ALIRO.COREUI class provides a tooltip object and a set of basic methods for constructing, displaying, and hiding custom tooltips. The most important method to focus on is "displayTooltip". This method accepts an DOM node reference or element id to use for alignment, tooltip text to use for the body, header, footer, positioning information, and a width.
Here is an example:
YUI.ALIRO.COREUI.tooltip.displayAdvTooltip.call('some-element-id', 'Tooltip body here', 'Tooltip header here', 'Tooltip footer here', 'TL', 'TR', '20em');
Note: In that example TL and TR and related to the overlayPosition and the nodePosition. For all possible positions use this reference.
A common use case for tooltips is the creation of the them in reference to an inline mouseover event. Since there are some scope complexities involved with such and action their is another convience method you should rely on for performing this task called "displayAdvTooltip". Here is an example:
<a href="javascript: void(0);" <?php echo $hover; ?> >foooo</a>
The two previous example would generate a more advanced tooltip as displayed in the following screenshot:
tooltip
Note: You are note limited to using raw text for the tooltip header, body, or footer. HTML is accepted.


Deletions:

Tooltip from Markup

To create a tooltip using PHP you can make use of the aliroHTML::toolTip() method. Here is a simple example
Here is a screenshot of the tooltip in action:
<a href="javascript: void(0);" <?php echo $hover; ?
foooo</a>
Note: you can pass in HTML




Revision [1211]

Edited on 2010-01-05 23:41:41 by ChadAuld

Additions:
Bring in the required JavaScript and CSS resources
aliroRequest::getInstance()->requestTooltip();
echo aliroHTML::getInstance()->toolTip($tip);
That will create the following DOM structure:
<a class="tooltip-container" href="#">
<img alt="Tool Tip" src="http://localhost/aliro_svn/includes/js/ThemeOffice/tooltip.png"/>
<span class="tooltip">Override your Template CSS file</span>
</a>
Aliro automatically watches for hover related events on all anchors with a class of "tooltip-container". It will open/close the tooltip on mouseover/mouseout.
Here is a screenshot of the tooltip in action:


Deletions:
$aliroHTML = aliroHTML::getInstance();
aliroRequest::getInstance()->requestTooltip(); bring in the required JavaScript and CSS resources
echo $aliroHTML->toolTip($tip);




Revision [1210]

The oldest known version of this page was edited on 2010-01-05 23:28:43 by ChadAuld

Tooltips


The YUI.ALIRO.COREUI JavaScript class provides functionality for creating system tooltips. Tooltips can be created using PHP or JavaScript. The PHP method will ultimately setup the JavaScript for you.

Tooltip from Markup


To create a tooltip using PHP you can make use of the aliroHTML::toolTip() method. Here is a simple example
$aliroHTML = aliroHTML::getInstance();
aliroRequest::getInstance()->requestTooltip(); //bring in the required JavaScript and CSS resources
		
$tip = T_('Override your Template CSS file');
echo $aliroHTML->toolTip($tip);


Advanced Tooltip

$hover = "onmouseover=\"YUI.ALIRO.COREUI.tooltip.displayAdvTooltip.call(this, 'Tooltip body here', 'Tooltip header here', 'Tooltip footer here', 'TL', 'TR', '20em');\"";
<a href="javascript: void(0);" <?php echo $hover; ?
foooo</a>

Note: you can pass in HTML

Differences from Mambo, MiaCMS, Joomla


In older versions of Mambo, MiaCMS, Joomla overLib was used to create tooltips. You can still utilize overLib with Aliro if you'd like, but you'll need to include/manage it as a separate library within your extension. It is not bundled in the core any longer and the core functions related to it have been removed. To cut down on 3rd party dependencies and maintain a consist/enterprise grade system all core UI elements are built on top of the Yahoo! User Interface Library (YUI). You are not required to utilize YUI, but we do recommend it.
Valid XHTML 1.0 Transitional :: Valid CSS :: Powered by WikkaWiki
Page was generated in 0.1791 seconds