mouseover popup (tooltip) for album description?

en7ropia

Joined: 2007-02-23
Posts: 4
Posted: Fri, 2007-05-25 22:04

Anyone know how to have a mouseover to trigger a javascript popup (toolip) that would contain the full description for an album, when looking at album items in the gallery. I am using a modded matrix theme and it only shows the "summary", but it would be nice to have a mouseover tooltip style popup that shows the full description.

I have seen javascript in pages like "itemdelete.tpl" that use the yahoo.widget that use the tooltip technique to show a larger size image on a mouseover.

I thought I might be able to use this for my purposes. But I'm not sure how to use it and if there may be a better way. Thanks for any help.

--start code snippet--

<script type="text/javascript">
//<![CDATA[
{foreach from=$ItemDelete.peers item=peer}
{if isset($peer.resize)}
{* force and alt/longdesc parameter here so that we avoid issues with single quotes in the title/description *}
new YAHOO.widget.Tooltip("gTooltip", {ldelim}
context: "thumb_{$peer.id}", text: '{g->image item=$peer image=$peer.resize class="giThumbnail" maxSize=640 alt="" longdesc="" }',
showDelay: 250 {rdelim});
{elseif isset($peer.thumbnail)}
new YAHOO.widget.Tooltip("gTooltip", {ldelim}
context: "thumb_{$peer.id}", text: '{g->image item=$peer image=$peer.thumbnail class="giThumbnail" alt="" longdesc=""}',
showDelay: 250 {rdelim});
{/if}
{/foreach}
//]]>

</script>

--end code snippet--

 
kamalpahuja

Joined: 2009-06-20
Posts: 11
Posted: Thu, 2009-08-27 00:44

can anyone help on this....i also need the same functionality

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16503
Posted: Fri, 2009-08-28 21:31

If you want to add javascript to smarty template files you need to put that between {literal} tags:

{literal}
   JAVASCRIPT CODE HERE
{/literal}

http://codex.gallery2.org/Gallery2:Editing_Templates

You'd want to edit /themes/YourTheme/templates/local/album.tpl assuming you read that link and copy album.tpl into a local directory you create for your theme's templates.
____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 22892
Posted: Fri, 2009-08-28 22:48
Quote:
I am using a modded matrix theme and it only shows the "summary"

In you code snippet I don't see how you are getting the summary.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 22892
Posted: Fri, 2009-08-28 22:51
Quote:
{$theme.item.description|markup}

Should give you the description on the item you are currently viewing.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team